{"openapi":"3.0.0","paths":{"/debug-sentry":{"get":{"operationId":"DebugSentryController_throwError","parameters":[{"name":"message","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["DebugSentry"]}},"/v1/hubs":{"post":{"operationId":"HubController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHubDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["hubs"]},"get":{"operationId":"HubController_findAll","parameters":[{"name":"skip","required":true,"in":"query","schema":{"type":"number"}},{"name":"take","required":true,"in":"query","schema":{"type":"number"}},{"name":"status","required":true,"in":"query","schema":{"type":"string"}},{"name":"babyId","required":false,"in":"query","description":"Optional baby ID to scope hasNewUpdates to the active baby","schema":{"type":"string"}},{"name":"language","required":true,"in":"query","schema":{"type":"string"}},{"name":"q","required":true,"in":"query","schema":{"type":"string"}},{"name":"orderBy","required":true,"in":"query","schema":{"type":"string"}},{"name":"sort","required":true,"in":"query","schema":{"type":"string"}},{"name":"authorization","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedHubsDto"}}}}},"security":[{"bearer":[]}],"tags":["hubs"]}},"/v1/hubs/{id}":{"get":{"operationId":"HubController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["hubs"]},"patch":{"operationId":"HubController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateHubDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["hubs"]},"delete":{"operationId":"HubController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["hubs"]}},"/auth/verify":{"get":{"operationId":"AuthController_verify","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdentityDto"}}}}},"security":[{"firebase-token":[]},{"bearer":[]}],"summary":"Verify token","tags":["Auth"]}},"/auth/email-link/send":{"post":{"description":"Generates the Firebase email sign-in link server-side and sends it with the Bubu Mailgun template. Mobile should still complete sign-in with Firebase using the email and received link.","operationId":"AuthController_sendEmailSignInLink","parameters":[{"name":"accept-language","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailSignInLinkDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailSignInLinkResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Send a branded Firebase email sign-in link","tags":["Auth"]}},"/auth/delete":{"delete":{"operationId":"AuthController_delete","parameters":[],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]},{"bearer":[]}],"summary":"Delete user","tags":["Auth"]}},"/v1/hub-updates/admin/by-user":{"get":{"operationId":"HubUpdatesController_getHubUpdatesByUserIdAdmin","parameters":[{"name":"userId","required":true,"in":"query","description":"User ID to get all hub updates for","schema":{"type":"string"}},{"name":"hubId","required":false,"in":"query","description":"Optional hub ID to return the exact user-visible feed for one hub","schema":{"type":"string"}},{"name":"babyId","required":false,"in":"query","description":"Optional baby ID to match the exact user request context","schema":{"type":"string"}},{"name":"language","required":false,"in":"query","description":"Language code (default: en)","schema":{"type":"string"}},{"name":"raw","required":false,"in":"query","description":"Return raw HubUpdate rows instead of the exact user-visible feed","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Exact hub-update view for the specified user, or raw HubUpdate rows when raw=true"}},"security":[{"bearer":[]}],"tags":["hub-updates"]}},"/v1/hub-updates/admin/user-view":{"get":{"operationId":"HubUpdatesController_getUserViewAdmin","parameters":[{"name":"userId","required":true,"in":"query","description":"User ID","schema":{"type":"string"}},{"name":"hubId","required":true,"in":"query","description":"Hub ID","schema":{"type":"string"}},{"name":"babyId","required":false,"in":"query","description":"Optional baby ID","schema":{"type":"string"}},{"name":"language","required":false,"in":"query","description":"Language code (default: en)","schema":{"type":"string"}}],"responses":{"200":{"description":"Hub updates exactly as the user sees them","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HubUpdatesResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["hub-updates"]}},"/v1/hub-updates/{hubId}":{"get":{"operationId":"HubUpdatesController_getHubUpdates","parameters":[{"name":"hubId","required":true,"in":"path","description":"Hub ID to get updates for","schema":{"type":"string"}},{"name":"babyId","required":false,"in":"query","description":"Optional baby ID to filter updates (falls back to first baby if not provided)","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HubUpdatesResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["hub-updates"]}},"/v1/hub-updates/{updateId}/seen":{"patch":{"operationId":"HubUpdatesController_markUpdateAsSeen","parameters":[{"name":"updateId","required":true,"in":"path","description":"Update ID to mark as seen","schema":{"type":"string"}}],"responses":{"200":{"description":"Update marked as seen successfully"}},"security":[{"bearer":[]}],"tags":["hub-updates"]}},"/v1/hub-updates/{updateId}/acted":{"patch":{"operationId":"HubUpdatesController_markUpdateAsActed","parameters":[{"name":"updateId","required":true,"in":"path","description":"Update ID to mark as acted upon","schema":{"type":"string"}}],"responses":{"200":{"description":"Update marked as acted upon successfully"}},"security":[{"bearer":[]}],"tags":["hub-updates"]}},"/v1/hub-updates/{updateId}/reaction":{"put":{"operationId":"HubUpdatesController_setUpdateReaction","parameters":[{"name":"updateId","required":true,"in":"path","description":"Hub update ID returned by the feed","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HubUpdateReactionRequestDto"}}}},"responses":{"200":{"description":"Reaction updated successfully"}},"security":[{"bearer":[]}],"tags":["hub-updates"]}},"/v1/hub-updates/{updateId}/save":{"put":{"operationId":"HubUpdatesController_setUpdateSaved","parameters":[{"name":"updateId","required":true,"in":"path","description":"Hub update ID returned by the feed","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HubUpdateSaveRequestDto"}}}},"responses":{"200":{"description":"Save state updated successfully"}},"security":[{"bearer":[]}],"tags":["hub-updates"]}},"/v1/hub-updates/{updateId}/submit":{"post":{"operationId":"HubUpdatesController_submitUpdateAnswers","parameters":[{"name":"updateId","required":true,"in":"path","description":"Hub update ID returned by the feed","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HubUpdateResultRequestDto"}}}},"responses":{"200":{"description":"Answers submitted and questionnaire result returned","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/HubUpdateResultResponseDto"},{"properties":{"result":{"oneOf":[{"$ref":"#/components/schemas/QuizResultDto"},{"$ref":"#/components/schemas/SurveyResultDto"}],"discriminator":{"propertyName":"type","mapping":{"quiz_result":"#/components/schemas/QuizResultDto","survey_result":"#/components/schemas/SurveyResultDto"}}}}}]}}}}},"security":[{"bearer":[]}],"tags":["hub-updates"]}},"/v1/hub-updates/questionnaire/answers":{"delete":{"operationId":"HubUpdatesController_deleteAllUserAnswers","parameters":[],"responses":{"200":{"description":"All user answers deleted successfully"}},"security":[{"bearer":[]}],"tags":["hub-updates"]}},"/v1/hub-updates/{updateId}/answers":{"delete":{"operationId":"HubUpdatesController_deleteUpdateAnswers","parameters":[{"name":"updateId","required":true,"in":"path","description":"Hub update ID returned by the feed","schema":{"type":"string"}}],"responses":{"200":{"description":"Answers for this update deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Answers deleted successfully"},"deletedCount":{"type":"number","example":5}}}}}}},"security":[{"bearer":[]}],"tags":["hub-updates"]}},"/v1/care-team/roles":{"get":{"operationId":"CareTeamController_getRoles","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRolesResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get available roles and relationship types for invitations","tags":["care-team"]}},"/v1/care-team/babies":{"get":{"operationId":"CareTeamController_getMyBabies","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMyBabiesResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["care-team"]},"post":{"operationId":"CareTeamController_createBaby","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBabyDto"}}}},"responses":{"200":{"description":"Baby created successfully and associated with user as OWNER","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BabyResponseDto"}}}},"404":{"description":"User profile not found"}},"security":[{"bearer":[]}],"summary":"Create a new baby and associate it with current user as OWNER","tags":["care-team"]}},"/v1/care-team/{babyId}/members":{"get":{"operationId":"CareTeamController_getTeamMembers","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTeamMembersResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["care-team"]}},"/v1/care-team/{babyId}/invite":{"post":{"operationId":"CareTeamController_inviteMember","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteMemberDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteMemberResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["care-team"]}},"/v1/care-team/{babyId}/members/{userId}":{"delete":{"operationId":"CareTeamController_removeMember","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}},{"name":"userId","required":true,"in":"path","description":"User ID to remove","schema":{"type":"string"}}],"responses":{"204":{"description":"Team member removed successfully"},"403":{"description":"Forbidden - Only the baby owner can remove team members"},"404":{"description":"Baby or team member not found"}},"security":[{"bearer":[]}],"tags":["care-team"]}},"/v1/care-team/babies/{babyId}":{"get":{"operationId":"CareTeamController_getBaby","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Returns the baby information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BabyResponseDto"}}}},"403":{"description":"Forbidden - Baby not associated with your care team"},"404":{"description":"Baby not found"}},"security":[{"bearer":[]}],"summary":"Get a baby by ID","tags":["care-team"]},"put":{"operationId":"CareTeamController_updateBaby","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBabyDto"}}}},"responses":{"200":{"description":"Baby updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BabyResponseDto"}}}},"403":{"description":"Forbidden - Only OWNER, CO_PARENT, or DAYCARE_TEACHER can update baby information"},"404":{"description":"Baby not found"}},"security":[{"bearer":[]}],"summary":"Update a baby (OWNER, CO_PARENT, and DAYCARE_TEACHER only)","tags":["care-team"]},"delete":{"operationId":"CareTeamController_deleteBaby","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"responses":{"204":{"description":"Baby deleted successfully"},"403":{"description":"Forbidden - Only the baby owner can delete the baby"},"404":{"description":"Baby not found"}},"security":[{"bearer":[]}],"summary":"Delete a baby (OWNER only)","tags":["care-team"]}},"/v1/babies/{babyId}/care-plans":{"get":{"operationId":"CarePlanController_list","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"hubId","required":false,"in":"query","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"enum":["ACTIVE","PAUSED","COMPLETED","ARCHIVED"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CarePlanResponseDto"}}}}}},"security":[{"bearer":[]}],"summary":"List care plans for a child","tags":["care-plan"]},"post":{"description":"A plan Bubu suggests does not exist until the parent accepts it; the client calls this then.","operationId":"CarePlanController_create","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCarePlanDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarePlanResponseDto"}}}},"409":{"description":"An active plan of this type already exists"}},"security":[{"bearer":[]}],"summary":"Create a care plan","tags":["care-plan"]}},"/v1/babies/{babyId}/care-plans/steps":{"get":{"description":"Curated steps (localized) plus this family's own added steps, deduplicated. Call after 2+ typed characters.","operationId":"CarePlanController_searchSteps","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"hubId","required":true,"in":"query","description":"Hub whose vocabulary to search.","schema":{"type":"string"}},{"name":"q","required":true,"in":"query","description":"Autocomplete text, 2–40 chars. `%`, `_` and `\\` are matched literally.","schema":{"example":"bat","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CareStepSearchResultDto"}}}}}},"security":[{"bearer":[]}],"summary":"Autocomplete the step vocabulary for the plan editor","tags":["care-plan"]}},"/v1/babies/{babyId}/care-plans/proposals":{"get":{"description":"Visible to the whole care team. Only a parent may accept or decline.","operationId":"CarePlanController_listProposals","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CarePlanProposalResponseDto"}}}}}},"security":[{"bearer":[]}],"summary":"Suggestions from Bubu awaiting a decision","tags":["care-plan"]}},"/v1/babies/{babyId}/care-plans/proposals/{proposalId}":{"put":{"description":"Parent only (OWNER / CO_PARENT). Replaces the suggested definition with the parent-edited one; custom wording is allowed exactly as in the plan editor. Guarded by baseRevision so a stale edit is refused, and accept refuses a claim whose revision moved.","operationId":"CarePlanController_editProposal","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"proposalId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditCarePlanProposalDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarePlanProposalResponseDto"}}}},"409":{"description":"Already answered, expired, or edited since baseRevision"}},"security":[{"bearer":[]}],"summary":"Adjust a Bubu suggestion before answering it","tags":["care-plan"]}},"/v1/babies/{babyId}/care-plans/proposals/{proposalId}/accept":{"post":{"description":"Applies the suggested routine as a plan create or a new plan version, atomically with the acceptance. Parent only (OWNER / CO_PARENT).","operationId":"CarePlanController_acceptProposal","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"proposalId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarePlanProposalDecisionResponseDto"}}}},"409":{"description":"Already answered, expired, or the plan changed since"}},"security":[{"bearer":[]}],"summary":"Accept a Bubu suggestion","tags":["care-plan"]}},"/v1/babies/{babyId}/care-plans/proposals/{proposalId}/decline":{"post":{"description":"Parent only (OWNER / CO_PARENT) — declining disposes of the suggestion for the whole family.","operationId":"CarePlanController_declineProposal","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"proposalId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarePlanProposalDecisionResponseDto"}}}},"409":{"description":"Already answered or expired"}},"security":[{"bearer":[]}],"summary":"Decline a Bubu suggestion","tags":["care-plan"]}},"/v1/babies/{babyId}/care-plans/{id}":{"get":{"operationId":"CarePlanController_get","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarePlanResponseDto"}}}},"404":{"description":"Not found for this child"}},"security":[{"bearer":[]}],"summary":"Get one care plan","tags":["care-plan"]},"put":{"description":"A parent edit is immediately confirmed and creates a new version. The submitted `steps` array order is preserved verbatim and IS the display order — the server never sorts by offsetMinutes, and two steps may share a clock time.","operationId":"CarePlanController_update","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCarePlanDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarePlanResponseDto"}}}},"409":{"description":"Conflict. The body carries a stable machine-readable `code` (e.g. plan_changed, day_already_recorded, active_plan_limit, write_contention) next to the human message — clients switch on `code`, never on message text. Codes are append-only; treat unknown codes as a generic conflict."}},"security":[{"bearer":[]}],"summary":"Edit a care plan","tags":["care-plan"]}},"/v1/babies/{babyId}/care-plans/{id}/days":{"get":{"description":"Derived from the schedule; only days the routine runs are returned. A day nobody answered comes back UNKNOWN, which never means \"not done\".","operationId":"CarePlanController_days","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"from","required":true,"in":"query","schema":{"example":"2026-07-20","type":"string"}},{"name":"to","required":true,"in":"query","schema":{"example":"2026-07-27","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarePlanDaysResponseDto"}}}},"400":{"description":"Invalid or too-wide date range"}},"security":[{"bearer":[]}],"summary":"Scheduled days with their check-ins","tags":["care-plan"]}},"/v1/babies/{babyId}/care-plans/{id}/check-ins":{"put":{"description":"Idempotent per plan-day and step. Never writes observed sleep — this only records what the parent confirms.","operationId":"CarePlanController_upsertCheckIn","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertCheckInDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarePlanCheckInResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Record how a routine day went","tags":["care-plan"]}},"/v1/babies/{babyId}/companion-prompts/current":{"get":{"operationId":"CompanionPromptController_getCurrent","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanionPromptCurrentResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get the current proactive Bubu bubble","tags":["companion prompts"]}},"/v1/babies/{babyId}/companion-prompts/{promptId}/dismiss":{"post":{"operationId":"CompanionPromptController_dismiss","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"promptId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanionPromptDto"}}}}},"security":[{"bearer":[]}],"summary":"Dismiss a proactive Bubu bubble","tags":["companion prompts"]}},"/v1/invitations/accept":{"post":{"operationId":"InvitationsController_acceptInvitation","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInvitationDto"}}}},"responses":{"200":{"description":"Invitation accepted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInvitationResponseDto"}}}},"400":{"description":"Invalid or expired invitation"},"404":{"description":"Invitation not found"},"409":{"description":"Already a team member"}},"security":[{"bearer":[]}],"summary":"Accept a care team invitation","tags":["invitations"]}},"/v1/invitations/decline":{"post":{"operationId":"InvitationsController_declineInvitation","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeclineInvitationDto"}}}},"responses":{"200":{"description":"Invitation declined successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeclineInvitationResponseDto"}}}},"400":{"description":"Invalid or expired invitation"},"404":{"description":"Invitation not found"}},"security":[{"bearer":[]}],"summary":"Decline a care team invitation","tags":["invitations"]}},"/v1/invitations/{invitationId}":{"delete":{"operationId":"InvitationsController_cancelInvitation","parameters":[{"name":"invitationId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation cancelled successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelInvitationResponseDto"}}}},"400":{"description":"Cannot cancel non-pending invitation"},"403":{"description":"Not authorized to cancel this invitation"},"404":{"description":"Invitation not found"}},"security":[{"bearer":[]}],"summary":"Cancel a pending invitation (inviter or owner only)","tags":["invitations"]}},"/v1/users/lookup":{"post":{"description":"Check if a parent already exists in BubuApp before creating a placeholder account. Returns user info and their babies.","operationId":"NurseryController_lookupUser","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLookupDto"}}}},"responses":{"200":{"description":"User lookup result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLookupResponseDto"}}}},"400":{"description":"Either email or phone must be provided"}},"security":[{"bearer":[]}],"summary":"Lookup user by email or phone","tags":["Nursery Integration"]}},"/v1/nursery/onboard":{"post":{"description":"Creates a new baby from nursery enrollment. If userId is provided, links baby to existing user. Otherwise, creates a new placeholder parent account.","operationId":"NurseryController_onboard","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NurseryOnboardDto"}}}},"responses":{"201":{"description":"Baby and parent created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NurseryOnboardResponseDto"}}}},"400":{"description":"Invalid request data"},"409":{"description":"Email and phone belong to different users"}},"security":[{"bearer":[]}],"summary":"Onboard baby and parent from nursery","tags":["Nursery Integration"]}},"/v1/nursery/add-care-team-member":{"post":{"description":"Adds a co-parent to a baby's care team. Looks up or creates the user in Firebase, then creates a pending invitation. Direct callers must be a CAREGIVER on the baby's care team. Trusted calls proxied through the nursery API may use the shared internal key instead.","operationId":"NurseryController_addCareTeamMember","parameters":[{"name":"x-internal-key","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCareTeamMemberDto"}}}},"responses":{"201":{"description":"Care team member added successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCareTeamMemberResponseDto"}}}},"400":{"description":"Invalid request data"},"402":{"description":"CO_PARENT limit reached"},"403":{"description":"Requesting user is not authorized for this baby"},"404":{"description":"Baby not found"},"409":{"description":"User is already on the care team"}},"security":[{"bearer":[]}],"summary":"Add a care team member to a baby","tags":["Nursery Integration"]}},"/v1/nursery/update-baby":{"post":{"description":"Trusted nursery-api proxy endpoint. Nursery staff edits to a linked child's name, birth date or allergies. Requires the shared internal key and the calling nursery's id, which must match the nursery the baby is linked to.","operationId":"NurseryController_updateBaby","parameters":[{"name":"x-internal-key","required":true,"in":"header","schema":{"type":"string"}},{"name":"x-internal-nursery-id","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NurseryUpdateBabyDto"}}}},"responses":{"200":{"description":"Baby updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BabyResponseDto"}}}},"403":{"description":"Missing or invalid internal key, missing nursery id, or baby not linked to this nursery"},"404":{"description":"Baby not found"}},"security":[{"bearer":[]}],"summary":"Update a nursery linked baby","tags":["Nursery Integration"]}},"/v1/nursery/send-parent-onboarding-notification":{"post":{"description":"Trusted nursery-api proxy endpoint used for manual parent invite resend.","operationId":"NurseryController_sendParentOnboardingNotification","parameters":[{"name":"x-internal-key","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendParentOnboardingNotificationDto"}}}},"responses":{"200":{"description":"Notification sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendParentOnboardingNotificationResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Send a nursery parent onboarding email","tags":["Nursery Integration"]}},"/v1/nursery/resend-care-team-invitation":{"post":{"description":"Trusted nursery-api proxy endpoint used for parent 2 invite resend.","operationId":"NurseryController_resendCareTeamInvitation","parameters":[{"name":"x-internal-key","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendCareTeamInvitationDto"}}}},"responses":{"200":{"description":"Invitation resent or skipped","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendCareTeamInvitationResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Resend an existing nursery-created care-team invitation","tags":["Nursery Integration"]}},"/v1/nursery/claim-parent-invitation":{"post":{"description":"Trusted nursery-api proxy endpoint. Makes the authenticated Firebase UID the durable parent account for a nursery-created Bubu baby.","operationId":"NurseryController_claimParentInvitation","parameters":[{"name":"x-internal-key","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimParentInvitationDto"}}}},"responses":{"200":{"description":"Nursery parent invitation claimed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimParentInvitationResponseDto"}}}},"403":{"description":"Missing or invalid internal key"},"404":{"description":"Baby not found"}},"security":[{"bearer":[]}],"summary":"Claim a nursery parent invitation for the authenticated parent","tags":["Nursery Integration"]}},"/v1/nursery-parent-invitations/preview":{"post":{"description":"BubuApp facade endpoint for the parent app. Keeps mobile on the BubuApp API base URL while forwarding to nursery-api, where invitation codes are owned.","operationId":"NurseryParentInvitationsController_preview","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NurseryParentInvitationCodeDto"}}}},"responses":{"200":{"description":"Invitation preview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NurseryParentInvitationPreviewResponseDto"}}}}},"summary":"Preview a nursery parent invitation code","tags":["nursery-parent-invitations"]}},"/v1/nursery-parent-invitations/claim":{"post":{"description":"BubuApp facade endpoint for the parent app. Authenticates the request, then forwards the original Firebase bearer token to nursery-api, where invitation codes are owned.","operationId":"NurseryParentInvitationsController_claim","parameters":[{"name":"authorization","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NurseryParentInvitationClaimRequestDto"}}}},"responses":{"200":{"description":"Invitation claimed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NurseryParentInvitationClaimResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Claim a nursery parent invitation code","tags":["nursery-parent-invitations"]}},"/v1/sleep-hub/sessions":{"post":{"operationId":"SleepHubController_createSession","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionDto"}}}},"responses":{"201":{"description":"Session created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponseDto"}}}},"400":{"description":"Invalid input"},"409":{"description":"An in-progress session already exists for this baby"}},"security":[{"bearer":[]}],"summary":"Create a sleep session. Omit actualEnd to start a timer (in-progress); include it to log retrospectively (completed).","tags":["sleep-hub"]}},"/v1/sleep-hub/babies/{babyId}/log":{"get":{"operationId":"SleepHubController_getLog","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}},{"name":"include","required":false,"in":"query","description":"Comma-separated relations to include. Supported: nightWakings.","schema":{"example":"nightWakings","type":"string"}},{"name":"from","required":false,"in":"query","description":"ISO-8601 lower bound on actualStart.","schema":{"type":"string"}},{"name":"to","required":false,"in":"query","description":"ISO-8601 upper bound on actualStart.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SleepLogResponseDto"}}}},"400":{"description":"Invalid query params"},"404":{"description":"Baby not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"Get sleep sessions for a baby. In-progress sessions are included (actualEnd and totalSleepMin are null).","tags":["sleep-hub"]}},"/v1/sleep-hub/babies/{babyId}/sessions/current":{"get":{"operationId":"SleepHubController_getCurrentSession","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"responses":{"200":{"description":"In-progress session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponseDto"}}}},"204":{"description":"No in-progress session"},"404":{"description":"Baby not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"Get the baby's in-progress sleep session if any. Used on app startup to restore a running timer.","tags":["sleep-hub"]}},"/v1/sleep-hub/sessions/{id}":{"get":{"operationId":"SleepHubController_getSession","parameters":[{"name":"id","required":true,"in":"path","description":"Session ID","schema":{"type":"string"}},{"name":"include","required":false,"in":"query","description":"Comma-separated relations to include. Supported: nightWakings.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponseDto"}}}},"404":{"description":"Session not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"Get a single sleep session by id.","tags":["sleep-hub"]},"patch":{"operationId":"SleepHubController_updateSession","parameters":[{"name":"id","required":true,"in":"path","description":"Session ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSessionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponseDto"}}}},"400":{"description":"Invalid input, or attempted to clear actualEnd on a completed session"},"403":{"description":"Nursery-logged nap (permissions.canEdit is false): read-only in the Sleep Hub"},"404":{"description":"Session not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"Edit a sleep session. Setting actualEnd on an in-progress session stops the timer. Setting actualEnd to null on a completed session is rejected.","tags":["sleep-hub"]},"delete":{"operationId":"SleepHubController_deleteSession","parameters":[{"name":"id","required":true,"in":"path","description":"Session ID","schema":{"type":"string"}}],"responses":{"204":{"description":"Session deleted"},"403":{"description":"Nursery-logged nap (permissions.canDelete is false): read-only in the Sleep Hub"},"404":{"description":"Session not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"Delete a sleep session and its night wakings. Works on in-progress and completed sessions (covers the \"Discard session\" intent).","tags":["sleep-hub"]}},"/v1/sleep-hub/sessions/{id}/night-wakings":{"post":{"operationId":"SleepHubController_createNightWaking","parameters":[{"name":"id","required":true,"in":"path","description":"Session ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNightWakingDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NightWakingResponseDto"}}}},"400":{"description":"wakeStart/wakeEnd falls outside the session window"},"404":{"description":"Session not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"Log a night waking against a session. Zero-form intent: only wakeStart is required — the server records a zero-duration waking at that instant.","tags":["sleep-hub"]},"get":{"operationId":"SleepHubController_listNightWakings","parameters":[{"name":"id","required":true,"in":"path","description":"Session ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NightWakingResponseDto"}}}}},"404":{"description":"Session not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"List night wakings for a session, ordered by wakeStart ascending.","tags":["sleep-hub"]}},"/v1/sleep-hub/night-wakings/{id}":{"patch":{"operationId":"SleepHubController_updateNightWaking","parameters":[{"name":"id","required":true,"in":"path","description":"Night waking ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNightWakingDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NightWakingResponseDto"}}}},"400":{"description":"Timing change falls outside the parent session window"},"404":{"description":"Waking not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"Edit a night waking.","tags":["sleep-hub"]},"delete":{"operationId":"SleepHubController_deleteNightWaking","parameters":[{"name":"id","required":true,"in":"path","description":"Night waking ID","schema":{"type":"string"}}],"responses":{"204":{"description":"Waking deleted"},"404":{"description":"Waking not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"Delete a single night waking.","tags":["sleep-hub"]}},"/v1/sleep-hub/babies/{babyId}/settings":{"get":{"operationId":"SleepHubController_getSettings","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponseDto"}}}},"404":{"description":"Baby not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"Get the baby's sleep schedule windows. Returns an empty array if none are configured.","tags":["sleep-hub"]},"put":{"operationId":"SleepHubController_upsertSettings","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertSettingsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponseDto"}}}},"400":{"description":"Invalid HH:MM format on a window"},"404":{"description":"Baby not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"Replace the baby's sleep schedule windows in one atomic transaction. Existing windows are deleted; the payload becomes the new set.","tags":["sleep-hub"]}},"/v1/sleep-hub/insights":{"get":{"description":"Deterministic statistics computed from logged sleep sessions across ALL caregivers. Durations are net sleep (recorded waking time subtracted), days are grouped in the baby OWNER's timezone (UTC fallback, flagged), and averages divide by tracked days or completed nights — today and in-progress sessions never enter denominators.","operationId":"SleepHubController_getInsights","parameters":[{"name":"babyId","required":true,"in":"query","schema":{"type":"string"}},{"name":"from","required":true,"in":"query","description":"YYYY-MM-DD","schema":{"type":"string"}},{"name":"to","required":true,"in":"query","description":"YYYY-MM-DD","schema":{"type":"string"}},{"name":"type","required":false,"in":"query","description":"Filter pill. Defaults to \"all\".","schema":{"enum":["all","naps","night"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightsResponseDto"}}}},"400":{"description":"Invalid query params"},"404":{"description":"Baby not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"Get sleep trends and statistics for a baby","tags":["sleep-hub"]}},"/v1/sleep-hub/babies/{babyId}/priority-card":{"get":{"description":"Answers \"what matters most right now, and what should this family do next\". The homepage renders items[].compact; swiping up renders items[].expanded, joined by itemId. The card state, the evidence and the action ids are chosen deterministically by the backend from logged sleep across ALL caregivers, grouped in the baby OWNER's timezone. Nothing here is a diagnosis and no cause is ever asserted.","operationId":"SleepHubController_getPriorityCard","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SleepPriorityCardResponseDto"}}}},"404":{"description":"Baby not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"The one Sleep Priority Card for a baby","tags":["sleep-hub"]}},"/v1/sleep-hub/babies/{babyId}/signal":{"get":{"description":"The strongest current change signal (more night wakings, shorter first stretch, or less total sleep), derived from the child's own recent nights versus their own baseline — never a population, never a cause. signal is null when nothing is elevated, data is stale, or there is not enough history to compare.","operationId":"SleepHubController_getLatestSignal","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SleepSignalResponseDto"}}}},"404":{"description":"Baby not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"The latest deterministic sleep signal for a baby","tags":["sleep-hub"]}},"/v1/sleep-hub/goals":{"get":{"operationId":"SleepHubController_listGoals","parameters":[{"name":"language","required":false,"in":"query","schema":{"default":"en-GB","example":"en-GB","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SleepGoalResponseDto"}}}}}},"security":[{"bearer":[]}],"summary":"List the sleep goal catalog (active goals only)","tags":["sleep-hub"]}},"/v1/sleep-hub/babies/{babyId}/goals":{"get":{"operationId":"SleepHubController_getBabyGoals","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BabySleepGoalsResponseDto"}}}},"404":{"description":"Baby not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"Get the sleep goals currently selected for a baby","tags":["sleep-hub"]},"put":{"operationId":"SleepHubController_setBabyGoals","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBabySleepGoalsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BabySleepGoalsResponseDto"}}}},"400":{"description":"Unknown or inactive goalIds"},"404":{"description":"Baby not found or caller not on care team"}},"security":[{"bearer":[]}],"summary":"Replace the baby's sleep goals. Existing selections are deleted; the payload becomes the new set.","tags":["sleep-hub"]}},"/v1/sleep-hub/resources/guides":{"post":{"operationId":"SleepHubResourcesController_createGuide","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGuideDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuideDetailResponseDto"}}}},"403":{"description":"Admin only"},"409":{"description":"Slug already exists"}},"security":[{"bearer":[]}],"summary":"Create a sleep guide (admin)","tags":["sleep-hub-resources"]},"get":{"operationId":"SleepHubResourcesController_listGuides","parameters":[{"name":"language","required":false,"in":"query","schema":{"default":"en-GB","example":"en-GB","type":"string"}},{"name":"skip","required":false,"in":"query","schema":{"minimum":0,"default":0,"type":"number"}},{"name":"take","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":20,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedGuidesDto"}}}}},"security":[{"bearer":[]}],"summary":"List active sleep guides","tags":["sleep-hub-resources"]}},"/v1/sleep-hub/resources/guides/{id}":{"get":{"operationId":"SleepHubResourcesController_getGuide","parameters":[{"name":"id","required":true,"in":"path","description":"Guide ID or slug","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuideDetailResponseDto"}}}},"404":{"description":"Guide not found"}},"security":[{"bearer":[]}],"summary":"Get a sleep guide with all sections","tags":["sleep-hub-resources"]},"patch":{"operationId":"SleepHubResourcesController_updateGuide","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGuideDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuideDetailResponseDto"}}}},"403":{"description":"Admin only"},"404":{"description":"Guide not found"}},"security":[{"bearer":[]}],"summary":"Update a sleep guide (admin)","tags":["sleep-hub-resources"]},"delete":{"operationId":"SleepHubResourcesController_softDeleteGuide","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Guide deactivated"},"403":{"description":"Admin only"},"404":{"description":"Guide not found"}},"security":[{"bearer":[]}],"summary":"Soft-delete a sleep guide (admin)","tags":["sleep-hub-resources"]}},"/v1/sleep-hub/babies/{babyId}/onboarding":{"get":{"operationId":"SleepOnboardingController_getState","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingStateResponseDto"}}}},"404":{"description":"No active sleep onboarding questionnaire configured"}},"security":[{"bearer":[]}],"summary":"Sleep onboarding state: versioned question set + resume data","tags":["Sleep Hub"]}},"/v1/sleep-hub/babies/{babyId}/onboarding/answers":{"put":{"operationId":"SleepOnboardingController_saveAnswers","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveOnboardingAnswersDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveOnboardingAnswersResponseDto"}}}},"400":{"description":"Empty batch, unknown questionId for the version, or value/skipped both present or both absent"},"404":{"description":"Unknown questionnaire version"}},"security":[{"bearer":[]}],"summary":"Partial save of onboarding answers (version-pinned, atomic)","tags":["Sleep Hub"]}},"/v1/sleep-hub/babies/{babyId}/onboarding/complete":{"post":{"operationId":"SleepOnboardingController_complete","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteOnboardingDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteOnboardingResponseDto"}}}},"404":{"description":"Unknown questionnaire version"}},"security":[{"bearer":[]}],"summary":"Explicit, idempotent completion — a retry returns the original timestamp","tags":["Sleep Hub"]}},"/v1/internal/sleep-onboarding/answer":{"post":{"operationId":"SleepOnboardingInternalController_persistAnswer","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalOnboardingAnswerDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalOnboardingAnswerResponseDto"}}}}},"summary":"Persist a Companion-collected onboarding answer (idempotent; errors are retryable)","tags":["Internal"]}},"/v1/internal/sleep-onboarding/context":{"get":{"operationId":"SleepOnboardingInternalController_getContext","parameters":[{"name":"userId","required":true,"in":"query","schema":{"type":"string"}},{"name":"babyId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"summary":"The session caregiver's onboarding answers for Companion context. Scoped to userId + babyId: verbatim wording never crosses caregivers.","tags":["Internal"]}},"/v1/internal/nursery-naps":{"post":{"operationId":"NurseryNapMirrorController_mirrorNap","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MirrorNurseryNapDto"}}}},"responses":{"201":{"description":"{ synced, reason }"}},"summary":"Upsert or remove the SleepSession mirror of a nursery-logged nap (idempotent)","tags":["Internal"]}},"/v1/internal/nursery-naps/remove":{"post":{"operationId":"NurseryNapMirrorController_removeMirrors","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveNurseryNapMirrorsDto"}}}},"responses":{"201":{"description":"{ synced, reason, removed }"}},"summary":"Remove all imported nursery-nap mirrors for a corrected nursery child link","tags":["Internal"]}},"/v1/memory-hub/{babyId}/memories":{"post":{"operationId":"MemoryHubController_createMemory","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMemoryDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryResponseDto"}}}},"400":{"description":"Invalid input"}},"security":[{"bearer":[]}],"summary":"Add a memory manually — one line is enough","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/assets":{"post":{"description":"Size ceilings per type: photo/artwork 15MB, voice 10MB, video 25MB (and 5 minutes). Compress video client-side before uploading — these limits exist because the server holds the file in memory while it generates the poster frame. Over the limit answers 413.","operationId":"MemoryHubController_uploadAsset","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"assetType":{"type":"string","enum":["PHOTO","VIDEO","VOICE","ARTWORK"],"description":"Optional — inferred from mimetype when omitted"}},"required":["file"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryAssetResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Upload a photo/video/voice/artwork file. Returns an unattached asset; pass its id in POST memories to attach it.","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/assets/direct-uploads":{"post":{"description":"For VIDEO only. The file never passes through the API: PUT it to `upload.url` with exactly `upload.headers` (the signature binds the content type, the exact byte size and create-only semantics, so a PUT retried after a lost response answers 412: just call `complete`), then call `complete`. The server transcodes to a 720p H.264 rendition and a poster; poll `GET assets/:assetId` until status is READY (url/thumbnailUrl appear) or FAILED (processingError holds a stable code). Only READY assets can be attached to a memory or a first. Limits: 500MB, 5 minutes, 4K. Answers 503 while the feature is disabled on the environment.","operationId":"MemoryHubController_createDirectUpload","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDirectUploadDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectUploadResponseDto"}}}},"400":{"description":"Unsupported type or content type"},"413":{"description":"Declared size over the limit"},"503":{"description":"Direct upload disabled"}},"security":[{"bearer":[]}],"summary":"Start a direct video upload: returns a signed storage URL to PUT the raw file to, plus the asset in PENDING_UPLOAD.","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/assets/{assetId}/complete":{"post":{"description":"Idempotent for an asset already PROCESSING or READY. 400 when nothing was uploaded, the upload window expired, or the object has the wrong Content-Type; 413 when the object is over the limit (the asset becomes FAILED); 409 for a FAILED asset.","operationId":"MemoryHubController_completeDirectUpload","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}},{"name":"assetId","required":true,"in":"path","description":"Memory asset ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryAssetResponseDto"}}}},"403":{"description":"Not the uploader, owner or co-parent"}},"security":[{"bearer":[]}],"summary":"Tell the server the PUT finished: the object is verified and the transcode is queued (asset becomes PROCESSING).","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/assets/{assetId}":{"get":{"operationId":"MemoryHubController_getAsset","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}},{"name":"assetId","required":true,"in":"path","description":"Memory asset ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryAssetResponseDto"}}}},"403":{"description":"Unattached upload of another user"},"404":{"description":"Asset not found for this baby"}},"security":[{"bearer":[]}],"summary":"Read one asset, e.g. to poll a direct upload until READY or FAILED","tags":["memory-hub"]},"delete":{"operationId":"MemoryHubController_deleteAsset","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}},{"name":"assetId","required":true,"in":"path","description":"Memory asset ID","schema":{"type":"string"}}],"responses":{"204":{"description":""},"409":{"description":"Asset is already attached"}},"security":[{"bearer":[]}],"summary":"Delete a cancelled, unattached memory upload","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/memories/{memoryId}":{"get":{"operationId":"MemoryHubController_getMemory","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}},{"name":"memoryId","required":true,"in":"path","description":"Memory ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Read one memory for a full-screen view or deep link","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/memories/{memoryId}/regenerate-caption":{"post":{"operationId":"MemoryHubController_regenerateCaption","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"memoryId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Generate another caption for a draft memory","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/memories/{memoryId}/publish":{"post":{"operationId":"MemoryHubController_publishMemory","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"memoryId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Publish a parent-approved draft memory","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/favorite-books":{"get":{"operationId":"MemoryHubController_listFavoriteBooks","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"skip","required":false,"in":"query","description":"Items to skip","schema":{"default":0,"type":"number"}},{"name":"take","required":false,"in":"query","description":"Items to take","schema":{"default":20,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteBooksResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List the child’s favorite books","tags":["memory-hub"]},"post":{"operationId":"MemoryHubController_createFavoriteBook","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFavoriteBookDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Add a favorite book from a title or cover photo","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/favorite-books/{memoryId}":{"patch":{"operationId":"MemoryHubController_updateFavoriteBook","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"memoryId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFavoriteBookDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Update a favorite book title or parent note","tags":["memory-hub"]},"delete":{"operationId":"MemoryHubController_deleteFavoriteBook","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"memoryId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Remove a favorite book from the shelf","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/home":{"get":{"operationId":"MemoryHubController_getHome","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"The spine: one aggregated payload for the whole home scroll (hero, on this day, this week, timeline, firsts, voice, artwork, people, feature flags)","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/resurfacing-settings":{"get":{"operationId":"MemoryHubController_getResurfacingPreference","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryResurfacingPreferenceResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Read this parent’s resurfacing preference","tags":["memory-hub"]},"patch":{"operationId":"MemoryHubController_updateResurfacingPreference","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemoryResurfacingPreferenceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryResurfacingPreferenceResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Update this parent’s resurfacing preference","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/timeline":{"get":{"operationId":"MemoryHubController_getTimeline","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}},{"name":"skip","required":false,"in":"query","description":"Items to skip","schema":{"default":0,"type":"number"}},{"name":"take","required":false,"in":"query","description":"Items to take","schema":{"default":20,"type":"number"}},{"name":"type","required":false,"in":"query","description":"Filter by memory type (firsts are excluded when set)","schema":{"enum":["JOURNAL","FIRST_REACTION","QUOTE","FAVORITE","PHASE","PHOTO","VIDEO","VOICE","ARTWORK","NURSERY","TRIP","CELEBRATION","BRAVE","FUNNY"],"type":"string"}},{"name":"personId","required":false,"in":"query","description":"Filter by tagged person id (firsts are excluded when set — they have no tagged people)","schema":{"type":"string"}},{"name":"place","required":false,"in":"query","description":"Filter by place (case-insensitive contains)","schema":{"type":"string"}},{"name":"from","required":false,"in":"query","description":"ISO-8601 lower bound on memoryDate","schema":{"type":"string"}},{"name":"to","required":false,"in":"query","description":"ISO-8601 upper bound on memoryDate","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimelineResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Paginated timeline merging memories and firsts, newest first. Filters: type, from, to.","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/firsts":{"get":{"operationId":"MemoryHubController_getFirsts","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}},{"name":"skip","required":false,"in":"query","description":"Items to skip","schema":{"default":0,"type":"number"}},{"name":"take","required":false,"in":"query","description":"Items to take","schema":{"default":20,"type":"number"}},{"name":"category","required":false,"in":"query","description":"Filter firsts by category","schema":{"enum":["DEVELOPMENTAL","EMOTIONAL","EXPERIENTIAL"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirstsListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"The firsts room — reads DevelopmentalMilestone (hub-visible only), newest first. Filter by category.","tags":["memory-hub"]},"post":{"operationId":"MemoryHubController_createFirst","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFirstDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirstResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Record a first for the child","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/voice":{"get":{"operationId":"MemoryHubController_getVoiceRoom","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}},{"name":"skip","required":false,"in":"query","description":"Items to skip","schema":{"default":0,"type":"number"}},{"name":"take","required":false,"in":"query","description":"Items to take","schema":{"default":20,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetRoomResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"The voice room — paginated voice recordings, newest first","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/artwork":{"get":{"operationId":"MemoryHubController_getArtworkRoom","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}},{"name":"skip","required":false,"in":"query","description":"Items to skip","schema":{"default":0,"type":"number"}},{"name":"take","required":false,"in":"query","description":"Items to take","schema":{"default":20,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetRoomResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"The artwork room — paginated artwork gallery, newest first","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/video":{"get":{"operationId":"MemoryHubController_getVideoRoom","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}},{"name":"skip","required":false,"in":"query","description":"Items to skip","schema":{"default":0,"type":"number"}},{"name":"take","required":false,"in":"query","description":"Items to take","schema":{"default":20,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetRoomResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"The video room, newest first","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/people":{"get":{"operationId":"MemoryHubController_getPeople","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PersonResponseDto"}}}}}},"security":[{"bearer":[]}],"summary":"People & relationships in the child’s story","tags":["memory-hub"]},"post":{"operationId":"MemoryHubController_createPerson","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePersonDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Add a person (mum, grandma, teacher, the dog…)","tags":["memory-hub"]}},"/v1/memory-hub/{babyId}/people/{personId}":{"patch":{"operationId":"MemoryHubController_updatePerson","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}},{"name":"personId","required":true,"in":"path","description":"Person ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePersonDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonResponseDto"}}}},"403":{"description":"Not allowed to edit people"},"404":{"description":"Person not found"}},"security":[{"bearer":[]}],"summary":"Update a person. Owners and co-parents only.","tags":["memory-hub"]}},"/v1/memory-hub/memories/{id}":{"patch":{"operationId":"MemoryHubController_updateMemory","parameters":[{"name":"id","required":true,"in":"path","description":"Memory ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemoryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryResponseDto"}}}},"403":{"description":"Not allowed to edit this memory"},"404":{"description":"Memory not found"}},"security":[{"bearer":[]}],"summary":"Edit a memory (title, text, date, place, tags, people). Owners, co-parents, or the creator only.","tags":["memory-hub"]}},"/v1/memory-hub/memories/{id}/hide":{"post":{"operationId":"MemoryHubController_hideMemory","parameters":[{"name":"id","required":true,"in":"path","description":"Memory ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryResponseDto"}}}},"403":{"description":"Not allowed to hide this memory"},"404":{"description":"Memory not found"}},"security":[{"bearer":[]}],"summary":"Hide a memory from the timeline (soft remove). Owners, co-parents, or the creator only.","tags":["memory-hub"]}},"/files":{"get":{"operationId":"FileController_findAll","parameters":[],"responses":{"200":{"description":"List of files retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileDto"}}}}}},"security":[{"firebase-token":[]}],"summary":"Retrieve all files","tags":["Files"]},"post":{"operationId":"FileController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDto"}}}},"responses":{"201":{"description":"File record created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Create a file record for an already uploaded file","tags":["Files"]}},"/files/{id}":{"get":{"operationId":"FileController_findOne","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the file","schema":{"type":"string"}}],"responses":{"200":{"description":"File retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDto"}}}},"404":{"description":"File not found"}},"security":[{"firebase-token":[]}],"summary":"Retrieve a file by ID","tags":["Files"]},"put":{"operationId":"FileController_update","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the file to update","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDto"}}}},"responses":{"200":{"description":"File record updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDto"}}}},"404":{"description":"File not found"}},"security":[{"firebase-token":[]}],"summary":"Update an existing file record","tags":["Files"]},"delete":{"operationId":"FileController_remove","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the file to delete","schema":{"type":"string"}}],"responses":{"200":{"description":"File record deleted successfully"},"404":{"description":"File not found"}},"security":[{"firebase-token":[]}],"summary":"Delete a file record and remove from Firebase Storage","tags":["Files"]}},"/files/upload":{"post":{"operationId":"FileController_uploadFile","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"File to upload"}},"required":["file"]}}}},"responses":{"200":{"description":"File uploaded successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Upload a file to Firebase Storage","tags":["Files"]}},"/v1/companion/care-plan-proposal":{"post":{"description":"Identity comes from the resolved Companion session, never from the request. Step keys must exist in the hub vocabulary; labels are materialized server-side.","operationId":"CompanionController_proposeCarePlan","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposeCarePlanDto"}}}},"responses":{"201":{"description":""}},"security":[{"x-companion-secret":[]}],"summary":"Suggest a care routine for parent confirmation","tags":["companion"]},"get":{"description":"The authoritative pre-propose check: the materialized context copy can be a day stale. Identity from the resolved Companion session.","operationId":"CompanionController_pendingCarePlanProposal","parameters":[{"name":"companion_session_id","required":true,"in":"query","description":"Server-owned id for the authenticated Companion session","schema":{"type":"string"}},{"name":"hub_id","required":true,"in":"query","description":"Hub the routine belongs to.","schema":{"type":"string"}},{"name":"plan_type_key","required":false,"in":"query","description":"Distinguishes concurrent plans within one hub.","schema":{"default":"routine","type":"string"}}],"responses":{"200":{"description":""}},"security":[{"x-companion-secret":[]}],"summary":"The live pending suggestion for a routine, or null","tags":["companion"]}},"/v1/companion/care-plan-proposal/withdraw":{"post":{"description":"The parent's spoken decision executed by the agent — parent-only server-side, exactly as privileged as decline. Nothing pending answers { withdrawn: false }, not an error.","operationId":"CompanionController_withdrawCarePlanProposal","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawCarePlanProposalDto"}}}},"responses":{"201":{"description":""}},"security":[{"x-companion-secret":[]}],"summary":"Retract the routine's pending suggestion","tags":["companion"]}},"/v1/companion/care-plan-steps":{"get":{"description":"Global curated content, no child data. A tool call rather than a prompt-baked list, so the vocabulary cannot drift silently.","operationId":"CompanionController_carePlanSteps","parameters":[{"name":"hub_id","required":true,"in":"query","description":"Hub to list the vocabulary for.","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"x-companion-secret":[]}],"summary":"Active step vocabulary the Companion may propose from","tags":["companion"]}},"/v1/companion/action-proposals/log":{"post":{"operationId":"CompanionController_proposeLogEvent","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogEventDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanionActionProposalResponseDto"}}}}},"security":[{"x-companion-secret":[]}],"summary":"Propose a care event for parent confirmation","tags":["companion"]}},"/v1/companion/action-proposals/note":{"post":{"operationId":"CompanionController_proposeNote","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveNoteDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanionActionProposalResponseDto"}}}}},"security":[{"x-companion-secret":[]}],"summary":"Propose a note for parent confirmation","tags":["companion"]}},"/v1/companion/action-proposals/reminder":{"post":{"operationId":"CompanionController_proposeReminder","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanionActionProposalResponseDto"}}}}},"security":[{"x-companion-secret":[]}],"summary":"Propose a reminder change for parent confirmation","tags":["companion"]}},"/v1/companion/action-proposals/hub-update":{"post":{"operationId":"CompanionController_proposeHubUpdate","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddHubUpdateDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanionActionProposalResponseDto"}}}}},"security":[{"x-companion-secret":[]}],"summary":"Propose a hub update for parent confirmation","tags":["companion"]}},"/v1/companion/log":{"post":{"operationId":"CompanionController_logEvent","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogEventDto"}}}},"responses":{"201":{"description":""}},"security":[{"x-companion-secret":[]}],"tags":["companion"]}},"/v1/companion/fetch":{"get":{"operationId":"CompanionController_fetch","parameters":[{"name":"user_id","required":true,"in":"query","description":"Bubu user id (from the ElevenLabs session)","schema":{"type":"string"}},{"name":"baby_id","required":true,"in":"query","description":"Baby id the action is about","schema":{"type":"string"}},{"name":"companion_session_id","required":true,"in":"query","description":"Server-owned id for the authenticated Companion session","schema":{"type":"string"}},{"name":"resource","required":true,"in":"query","description":"Resource to read back (see COMPANION_TOOLS_V1.md)","schema":{"enum":["upcoming_reminders","due_actions","sleep_history","milestone_progress","routines"],"type":"string"}},{"name":"range","required":false,"in":"query","schema":{"enum":["today","yesterday","7d","30d"],"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"x-companion-secret":[]}],"tags":["companion"]}},"/v1/companion/history":{"get":{"description":"Reads the saved companion conversation scoped to the session's baby and to the hub of the session's agent — both derived server-side, never from tool input. Agents without a hub mapping are refused (403). Messages saved before hub stamping (Aug 2026) are excluded by the strict baby match.","operationId":"CompanionController_conversationHistory","parameters":[{"name":"user_id","required":true,"in":"query","description":"Bubu user id (from the ElevenLabs session)","schema":{"type":"string"}},{"name":"baby_id","required":true,"in":"query","description":"Baby id the action is about","schema":{"type":"string"}},{"name":"companion_session_id","required":true,"in":"query","description":"Server-owned id for the authenticated Companion session","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum messages returned, newest first cut. Default 50.","schema":{"example":50,"type":"number"}},{"name":"before","required":false,"in":"query","description":"Opaque cursor from a previous response (`next_before`). Returns the page of messages strictly OLDER than it, so a busy conversation pages back without the latest-N loss. Omit for the newest page.","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"x-companion-secret":[]}],"summary":"Conversation history for the session's baby and agent hub","tags":["companion"]}},"/v1/companion/note":{"post":{"operationId":"CompanionController_saveNote","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveNoteDto"}}}},"responses":{"201":{"description":""}},"security":[{"x-companion-secret":[]}],"tags":["companion"]}},"/v1/companion/reminder":{"post":{"operationId":"CompanionController_reminder","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderDto"}}}},"responses":{"201":{"description":""}},"security":[{"x-companion-secret":[]}],"tags":["companion"]}},"/v1/companion/plan":{"post":{"operationId":"CompanionController_createPlan","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlanDto"}}}},"responses":{"201":{"description":""}},"security":[{"x-companion-secret":[]}],"tags":["companion"]}},"/v1/companion/play-media":{"post":{"operationId":"CompanionController_playMedia","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlayMediaDto"}}}},"responses":{"201":{"description":""}},"security":[{"x-companion-secret":[]}],"tags":["companion"]}},"/v1/companion/launch-content":{"post":{"operationId":"CompanionController_launchContent","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LaunchContentDto"}}}},"responses":{"201":{"description":""}},"security":[{"x-companion-secret":[]}],"tags":["companion"]}},"/v1/companion/recommend":{"get":{"operationId":"CompanionController_recommendContent","parameters":[{"name":"user_id","required":true,"in":"query","description":"Bubu user id (from the ElevenLabs session)","schema":{"type":"string"}},{"name":"baby_id","required":true,"in":"query","description":"Baby id the action is about","schema":{"type":"string"}},{"name":"companion_session_id","required":true,"in":"query","description":"Server-owned id for the authenticated Companion session","schema":{"type":"string"}},{"name":"domain","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"x-companion-secret":[]}],"tags":["companion"]}},"/v1/companion/hub-update":{"post":{"operationId":"CompanionController_addHubUpdate","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddHubUpdateDto"}}}},"responses":{"201":{"description":""}},"security":[{"x-companion-secret":[]}],"tags":["companion"]}},"/v1/companion/summary":{"post":{"operationId":"CompanionController_generateSummary","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateSummaryDto"}}}},"responses":{"201":{"description":""}},"security":[{"x-companion-secret":[]}],"tags":["companion"]}},"/v1/companion/draft-message":{"post":{"operationId":"CompanionController_draftMessage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftMessageDto"}}}},"responses":{"201":{"description":""}},"security":[{"x-companion-secret":[]}],"tags":["companion"]}},"/v1/companion/email-reply/translate":{"post":{"operationId":"CompanionController_translateEmailReply","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslateEmailReplyDto"}}}},"responses":{"201":{"description":""}},"security":[{"x-companion-secret":[]}],"tags":["companion"]}},"/v1/companion/email-reply/propose":{"post":{"operationId":"CompanionController_proposeEmailReply","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposeEmailReplyDto"}}}},"responses":{"201":{"description":""}},"security":[{"x-companion-secret":[]}],"tags":["companion"]}},"/v1/companion/action-proposals/{proposalId}":{"get":{"operationId":"CompanionSessionController_getActionProposal","parameters":[{"name":"proposalId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanionActionProposalResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Get an owned Companion action proposal","tags":["companion"]},"patch":{"operationId":"CompanionSessionController_editActionProposal","parameters":[{"name":"proposalId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditCompanionActionProposalDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanionActionProposalResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Edit a pending Companion action proposal","tags":["companion"]}},"/v1/companion/action-proposals/{proposalId}/confirm":{"post":{"operationId":"CompanionSessionController_confirmActionProposal","parameters":[{"name":"proposalId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanionActionProposalResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Confirm and execute a Companion action proposal","tags":["companion"]}},"/v1/companion/action-proposals/{proposalId}/cancel":{"post":{"operationId":"CompanionSessionController_cancelActionProposal","parameters":[{"name":"proposalId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanionActionProposalResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Cancel a Companion action proposal","tags":["companion"]}},"/v1/companion/conversation-history":{"get":{"operationId":"CompanionSessionController_conversationHistory","parameters":[{"name":"babyId","required":true,"in":"query","description":"The child whose conversation to read","schema":{"type":"string"}},{"name":"hubId","required":true,"in":"query","description":"Hub scope, e.g. the Sleep hub id. Hubs never mix.","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum messages returned, newest first cut. Default 50.","schema":{"type":"number"}},{"name":"before","required":false,"in":"query","description":"Opaque cursor from a previous response (`next_before`); returns the page strictly older than it.","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]}],"summary":"Paged conversation history for a child and hub (parent-facing twin of the agent history tool)","tags":["companion"]}},"/v1/companion/opener":{"get":{"operationId":"CompanionSessionController_getOpener","parameters":[{"name":"babyId","required":true,"in":"query","description":"The explicitly selected child","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanionOpenerResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Get a privacy-safe opener without starting a provider session","tags":["companion"]}},"/v1/companion/session-start":{"post":{"operationId":"CompanionSessionController_startSession","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartCompanionSessionDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanionSessionStartResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Start an authenticated companion session (server-owned identity)","tags":["companion"]}},"/v1/companion/attachments":{"post":{"operationId":"CompanionSessionController_uploadAttachment","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"Image to share with the Companion (max 10MB)"},"companionSessionId":{"type":"string"},"conversationId":{"type":"string"}},"required":["file","companionSessionId","conversationId"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanionAttachmentResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Attach an image to the live Companion conversation (keeps a copy, returns the ElevenLabs file_id)","tags":["companion"]}},"/v1/babies/{babyId}/reminders":{"get":{"operationId":"RemindersController_listDue","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List due in-app reminder cards for a child","tags":["reminders"]}},"/v1/babies/{babyId}/reminders/{reminderId}/actions":{"post":{"operationId":"RemindersController_performAction","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}},{"name":"reminderId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderCardActionDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Complete, snooze, or cancel a reminder card","tags":["reminders"]}},"/v1/family-actions/{actionId}/reply/send":{"post":{"operationId":"FamilyRepliesController_send","parameters":[{"name":"actionId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendReplyDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Send the parent's reply from their Gmail, in the thread, to the original sender","tags":["family-actions"]}},"/v1/family-actions":{"post":{"operationId":"FamilyActionsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateManualActionDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"A parent adds an event or a to-do by hand","tags":["family-actions"]},"get":{"operationId":"FamilyActionsController_list","parameters":[{"name":"status","required":false,"in":"query","schema":{"default":"open","enum":["open","done","dismissed"],"type":"string"}},{"name":"listKey","required":false,"in":"query","description":"grocery, or packing:<childId>:<YYYY-MM-DD> (D-15)","schema":{"type":"string"}},{"name":"from","required":false,"in":"query","description":"ISO instant; window start, inclusive. Send with `to`.","schema":{"type":"string"}},{"name":"to","required":false,"in":"query","description":"ISO instant; window end, exclusive. Send with `from`.","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List the caller's family actions across their children","tags":["family-actions"]}},"/v1/family-actions/{actionId}/actions":{"post":{"operationId":"FamilyActionsController_perform","parameters":[{"name":"actionId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FamilyActionCommandDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Complete, reopen, dismiss, assign or edit a family action","tags":["family-actions"]}},"/v1/family-actions/{actionId}":{"delete":{"operationId":"FamilyActionsController_remove","parameters":[{"name":"actionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"A parent deletes an item they or another parent added","tags":["family-actions"]}},"/v1/integrations/google":{"get":{"operationId":"GoogleConnectionController_get","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"The caller's Google connection","tags":["integrations"]},"patch":{"operationId":"GoogleConnectionController_update","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGoogleConnectionDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Pause or resume, and choose the calendars Bubu may read","tags":["integrations"]},"delete":{"operationId":"GoogleConnectionController_disconnect","parameters":[],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Disconnect: revoke at Google and delete what came from this source","tags":["integrations"]}},"/v1/integrations/google/sender-suggestions":{"get":{"operationId":"GoogleConnectionController_senderSuggestions","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Likely school senders from the last 60 days of headers (no body is read, nothing is stored)","tags":["integrations"]}},"/v1/integrations/google/connect":{"post":{"operationId":"GoogleConnectionController_connect","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectGoogleDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Exchange a server auth code and connect (replaces any existing connection)","tags":["integrations"]}},"/v1/integrations/google/sync":{"post":{"operationId":"GoogleConnectionController_sync","parameters":[],"responses":{"202":{"description":""}},"security":[{"bearer":[]}],"summary":"Queue a health check now (once per 2 minutes)","tags":["integrations"]}},"/v1/integrations/google/reread":{"post":{"operationId":"GoogleConnectionController_reread","parameters":[],"responses":{"202":{"description":""}},"security":[{"bearer":[]}],"summary":"Remove everything Gmail produced for this account, and read the last 14 days again on the next sync","tags":["integrations"]}},"/v1/family-actions/parse":{"post":{"operationId":"FamilyActionParseController_parse","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParseFamilyActionDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Read a parent's sentence into a draft item, unsaved","tags":["family-actions"]}},"/v1/family/availability":{"post":{"operationId":"FamilyCoverageController_availabilityFor","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FamilyAvailabilityDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Free or busy for a child's caregivers over a window; times only, never what the event is","tags":["family-coverage"]}},"/v1/children/{babyId}/responsibilities":{"get":{"operationId":"ResponsibilitiesController_list","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Who usually does this child's pickups and drop-offs","tags":["family-coverage"]},"put":{"operationId":"ResponsibilitiesController_save","parameters":[{"name":"babyId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveResponsibilitiesDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Replace the rules (parents only) and regenerate the next 7 days of pickups","tags":["family-coverage"]}},"/v1/family/settings":{"get":{"operationId":"FamilySettingsController_get","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"The caller's School Inbox settings; the defaults when nothing is saved","tags":["family-settings"]},"patch":{"operationId":"FamilySettingsController_update","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFamilySettingsDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Save notification switches, or mark the onboarding finished (once)","tags":["family-settings"]}},"/v1/family-actions/{actionId}/calendar":{"post":{"operationId":"FamilyCalendarController_add","parameters":[{"name":"actionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Add a school event to the caller's own Google Calendar; answers once Google has","tags":["family-actions"]},"delete":{"operationId":"FamilyCalendarController_undo","parameters":[{"name":"actionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Undo: take the event Bubu added out of the calendar, until it starts and unless it was edited there","tags":["family-actions"]}},"/v1/voice-cloning/voices":{"get":{"operationId":"VoiceCloningController_listVoices","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceProfileListResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"List voice profiles owned by the current user","tags":["voice-cloning"]},"post":{"operationId":"VoiceCloningController_createVoice","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"Mom's Voice","description":"User-facing label for the cloned voice."},"language":{"type":"string","example":"en-GB","description":"Optional recording locale/language metadata."},"removeBackgroundNoise":{"type":"boolean","example":false,"description":"Optional ElevenLabs background-noise removal flag. Default false."},"files":{"type":"array","items":{"type":"string","format":"binary"},"description":"One merged audio file or multiple segment files. Preferred field name: files. files[] is also accepted by multipart clients."}},"required":["name","files"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceProfileResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Create a cloned voice from one merged audio file or multiple recording segments","tags":["voice-cloning"]}},"/v1/voice-cloning/voices/{voiceProfileId}/preview":{"post":{"operationId":"VoiceCloningController_previewVoice","parameters":[{"name":"voiceProfileId","required":true,"in":"path","description":"Bubu voice profile id","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewVoiceProfileDto"}}}},"responses":{"200":{"description":"MP3 audio bytes","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}}},"security":[{"firebase-token":[]}],"summary":"Generate a short MP3 preview using a cloned voice profile","tags":["voice-cloning"]}},"/v1/voice-cloning/voices/{voiceProfileId}":{"delete":{"operationId":"VoiceCloningController_deleteVoice","parameters":[{"name":"voiceProfileId","required":true,"in":"path","description":"Bubu voice profile id","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteVoiceProfileResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Delete a cloned voice profile and remove the provider voice from ElevenLabs","tags":["voice-cloning"]}},"/media/items":{"get":{"operationId":"MediaController_findAll","parameters":[{"name":"type","required":false,"in":"query","schema":{"type":"string"}},{"name":"language","required":false,"in":"query","schema":{"default":"en","type":"string"}},{"name":"artist","required":false,"in":"query","schema":{"type":"string"}},{"name":"categoryId","required":false,"in":"query","schema":{"type":"string"}},{"name":"text","required":false,"in":"query","schema":{"type":"string"}},{"name":"skip","required":false,"in":"query","schema":{"default":0,"type":"number"}},{"name":"take","required":false,"in":"query","schema":{"default":10,"type":"number"}},{"name":"orderBy","required":false,"in":"query","schema":{"type":"string"}},{"name":"order","required":false,"in":"query","schema":{"enum":["asc","desc"],"type":"string"}},{"name":"cursor","required":false,"in":"query","description":"Cursor for pagination","schema":{"type":"string"}},{"name":"favorite","required":false,"in":"query","description":"Whether to return favorite media","schema":{"type":"boolean"}},{"name":"babyId","required":false,"in":"query","description":"Baby ID used to scope favorite media","schema":{"type":"string"}},{"name":"featured","required":false,"in":"query","description":"Whether to return featured media","schema":{"type":"boolean"}}],"responses":{"200":{"description":"List of media items retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedMediaDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Retrieve all media items","tags":["Media"]},"post":{"operationId":"MediaAdminController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMediaDto"}}}},"responses":{"201":{"description":"Media item created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Create a new media item","tags":["Media Admin"]}},"/media/items/{id}":{"get":{"operationId":"MediaController_findOne","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item","schema":{"type":"string"}}],"responses":{"200":{"description":"Media item retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaDto"}}}},"404":{"description":"Media item not found"}},"security":[{"firebase-token":[]}],"summary":"Retrieve a media item by ID","tags":["Media"]},"put":{"operationId":"MediaAdminController_update","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item to update","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMediaDto"}}}},"responses":{"200":{"description":"Media item updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaDto"}}}},"404":{"description":"Media item not found"}},"security":[{"firebase-token":[]}],"summary":"Update an existing media item","tags":["Media Admin"]},"delete":{"operationId":"MediaAdminController_remove","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item to delete","schema":{"type":"string"}}],"responses":{"200":{"description":"Media item deleted successfully"},"404":{"description":"Media item not found"}},"security":[{"firebase-token":[]}],"summary":"Delete a media item","tags":["Media Admin"]}},"/media/custom-story":{"post":{"operationId":"MediaController_createCustomStory","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomStoryDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Create a custom story for the authenticated user","tags":["Media"]}},"/media/items/{id}/feedback":{"post":{"operationId":"MediaController_addFeedback","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackDto"}}}},"responses":{"200":{"description":"Feedback submitted successfully"}},"security":[{"firebase-token":[]}],"summary":"Submit user feedback for a media item","tags":["Media"]},"delete":{"operationId":"MediaController_removeFeedback","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item","schema":{"type":"string"}}],"responses":{"200":{"description":"Feedback removed successfully"},"404":{"description":"Media item not found"}},"security":[{"firebase-token":[]}],"summary":"Remove user feedback for a media item","tags":["Media"]}},"/media/items/{id}/favorite":{"post":{"operationId":"MediaController_addFavorite","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item","schema":{"type":"string"}},{"name":"babyId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Media item added to favorites"},"404":{"description":"Media item not found"}},"security":[{"firebase-token":[]}],"summary":"Add a media item to the user's favorites","tags":["Media"]},"delete":{"operationId":"MediaController_removeFavorite","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item","schema":{"type":"string"}},{"name":"babyId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Media item removed from favorites"},"404":{"description":"Media item not found"}},"security":[{"firebase-token":[]}],"summary":"Remove a media item from the user's favorites","tags":["Media"]}},"/media/retag":{"post":{"description":"Analyzes media descriptions and lyrics to suggest appropriate tags using OpenAI","operationId":"MediaController_retagMedia","parameters":[],"responses":{"200":{"description":"Retagging process completed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"processedCount":{"type":"number"},"successCount":{"type":"number"},"errorCount":{"type":"number"}}}}}}},"security":[{"firebase-token":[]}],"summary":"Retag media items using AI analysis","tags":["Media"]}},"/media/random-item":{"get":{"operationId":"MediaPlayerController_findRandomItem","parameters":[{"name":"type","required":false,"in":"query","schema":{"type":"string"}},{"name":"language","required":false,"in":"query","schema":{"default":"en","type":"string"}},{"name":"artist","required":false,"in":"query","schema":{"type":"string"}},{"name":"categoryId","required":false,"in":"query","schema":{"type":"string"}},{"name":"text","required":false,"in":"query","schema":{"type":"string"}},{"name":"skip","required":false,"in":"query","schema":{"default":0,"type":"number"}},{"name":"take","required":false,"in":"query","schema":{"default":10,"type":"number"}},{"name":"orderBy","required":false,"in":"query","schema":{"type":"string"}},{"name":"order","required":false,"in":"query","schema":{"enum":["asc","desc"],"type":"string"}},{"name":"cursor","required":false,"in":"query","description":"Cursor for pagination","schema":{"type":"string"}},{"name":"favorite","required":false,"in":"query","description":"Whether to return favorite media","schema":{"type":"boolean"}},{"name":"babyId","required":false,"in":"query","description":"Baby ID used to scope favorite media","schema":{"type":"string"}},{"name":"featured","required":false,"in":"query","description":"Whether to return featured media","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Random media item retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Retrieve random media item","tags":["Media Player"]}},"/media/items/{id}/play":{"post":{"operationId":"MediaPlayerController_recordPlay","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item","schema":{"type":"string"}}],"responses":{"200":{"description":"Play event recorded successfully"}},"security":[{"firebase-token":[]}],"summary":"Record a play event for a media item","tags":["Media Player"]}},"/media/items/{id}/previous":{"get":{"operationId":"MediaPlayerController_previousMedia","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"section","required":false,"in":"query","description":"The section to navigate within (favorites, recently_played, recommended, category_[id])","schema":{"type":"string"}}],"responses":{"200":{"description":"Previous media item retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Retrieve the previous media item","tags":["Media Player"]}},"/media/items/{id}/next":{"get":{"operationId":"MediaPlayerController_nextMedia","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"section","required":false,"in":"query","description":"The section to navigate within (favorites, recently_played, recommended, category_[id])","schema":{"type":"string"}}],"responses":{"200":{"description":"Next media item retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Retrieve the next media item","tags":["Media Player"]}},"/media/items/{id}/progress":{"put":{"operationId":"MediaPlayerController_recordProgress","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordProgressDto"}}}},"responses":{"200":{"description":"Progress event recorded successfully"},"404":{"description":"Media item not found"}},"security":[{"firebase-token":[]}],"summary":"Record a progress event for a media item","tags":["Media Player"]}},"/media/history":{"get":{"operationId":"MediaPlayerController_getUserHistory","parameters":[],"responses":{"200":{"description":"User play history retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MediaDto"}}}}}},"security":[{"firebase-token":[]}],"summary":"Get user play history","tags":["Media Player"]}},"/media/items/{id}/files":{"post":{"operationId":"MediaAdminController_addFiles","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"responses":{"200":{"description":"Files added successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileDto"}}}}}},"security":[{"firebase-token":[]}],"summary":"Add files to a media item","tags":["Media Admin"]},"delete":{"operationId":"MediaAdminController_removeFiles","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"responses":{"200":{"description":"Files removed successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileDto"}}}}}},"security":[{"firebase-token":[]}],"summary":"Remove files from a media item","tags":["Media Admin"]}},"/media/items/{id}/categories":{"post":{"operationId":"MediaAdminController_addCategories","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"responses":{"200":{"description":"Categories assigned successfully"}},"security":[{"firebase-token":[]}],"summary":"Assign categories to a media item","tags":["Media Admin"]},"delete":{"operationId":"MediaAdminController_removeCategories","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"responses":{"200":{"description":"Categories removed successfully"}},"security":[{"firebase-token":[]}],"summary":"Remove categories from a media item","tags":["Media Admin"]}},"/media/items/{id}/tags":{"post":{"operationId":"MediaAdminController_addTags","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"responses":{"200":{"description":"Tags assigned successfully"}},"security":[{"firebase-token":[]}],"summary":"Assign tags to a media item","tags":["Media Admin"]},"delete":{"operationId":"MediaAdminController_removeTags","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the media item","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"responses":{"200":{"description":"Tags removed successfully"}},"security":[{"firebase-token":[]}],"summary":"Remove tags from a media item","tags":["Media Admin"]}},"/media/categories":{"get":{"operationId":"MediaAdminController_findAllCategories","parameters":[{"name":"language","required":false,"in":"query","schema":{"default":"en","type":"string"}}],"responses":{"200":{"description":"Categories retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CategoryDto"}}}}}},"security":[{"firebase-token":[]}],"summary":"Get all categories","tags":["Media Admin"]},"post":{"operationId":"MediaAdminController_createCategory","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryDto"}}}},"responses":{"201":{"description":"Category created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Create a new category","tags":["Media Admin"]}},"/media/categories/{id}":{"get":{"operationId":"MediaAdminController_findOneCategory","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the category","schema":{"type":"string"}}],"responses":{"200":{"description":"Category retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryDto"}}}},"404":{"description":"Category not found"}},"security":[{"firebase-token":[]}],"summary":"Get a category by ID","tags":["Media Admin"]},"patch":{"operationId":"MediaAdminController_updateCategory","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the category","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryDto"}}}},"responses":{"200":{"description":"Category updated successfully"},"404":{"description":"Category not found"}},"security":[{"firebase-token":[]}],"summary":"Update a category by ID","tags":["Media Admin"]},"delete":{"operationId":"MediaAdminController_removeCategory","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the category","schema":{"type":"string"}}],"responses":{"200":{"description":"Category deleted successfully"},"404":{"description":"Category not found"}},"security":[{"firebase-token":[]}],"summary":"Delete a category by ID","tags":["Media Admin"]}},"/media/tags":{"get":{"operationId":"MediaAdminController_findAllTags","parameters":[{"name":"language","required":false,"in":"query","schema":{"default":"en","type":"string"}}],"responses":{"200":{"description":"Tags retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TagDto"}}}}}},"security":[{"firebase-token":[]}],"summary":"Get all tags","tags":["Media Admin"]},"post":{"operationId":"MediaAdminController_createTag","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagDto"}}}},"responses":{"201":{"description":"Tag created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Create a new tag","tags":["Media Admin"]}},"/media/tags/{id}":{"get":{"operationId":"MediaAdminController_findOneTag","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the tag","schema":{"type":"string"}}],"responses":{"200":{"description":"Tag retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagDto"}}}},"404":{"description":"Tag not found"}},"security":[{"firebase-token":[]}],"summary":"Get a tag by ID","tags":["Media Admin"]},"patch":{"operationId":"MediaAdminController_updateTag","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the tag","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagDto"}}}},"responses":{"200":{"description":"Tag updated successfully"},"404":{"description":"Tag not found"}},"security":[{"firebase-token":[]}],"summary":"Update a tag by ID","tags":["Media Admin"]},"delete":{"operationId":"MediaAdminController_removeTag","parameters":[{"name":"id","required":true,"in":"path","description":"Unique identifier of the tag","schema":{"type":"string"}}],"responses":{"200":{"description":"Tag deleted successfully"},"404":{"description":"Tag not found"}},"security":[{"firebase-token":[]}],"summary":"Delete a tag by ID","tags":["Media Admin"]}},"/ai-stories":{"post":{"description":"Generate a personalized bedtime story for the user based on their profile and preferences. The story generation happens asynchronously in the background.","operationId":"AiStoriesController_createStory","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStoryRequestDto"}}}},"responses":{"201":{"description":"Story generation request created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the story generation request"},"message":{"type":"string","description":"Success message"}}}}}},"400":{"description":"Invalid request data"},"401":{"description":"Unauthorized"},"404":{"description":"voiceProfileId does not resolve to a voice profile owned by the caller"},"409":{"description":"The selected voice profile is not READY or still requires verification"},"500":{"description":"Internal server error"}},"security":[{"firebase-token":[]}],"summary":"Create a new personalized story","tags":["AI Stories"]},"get":{"description":"Retrieve a paginated list of stories for the current user.","operationId":"AiStoriesController_getUserStories","parameters":[{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"example":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Number of stories per page (default: 10, max: 50)","schema":{"example":10,"type":"number"}}],"responses":{"200":{"description":"Stories retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoryListResponseDto"}}}},"401":{"description":"Unauthorized"}},"security":[{"firebase-token":[]}],"summary":"Get user stories","tags":["AI Stories"]}},"/ai-stories/{id}/status":{"get":{"description":"Check the current status of a story generation request, including progress and any errors.","operationId":"AiStoriesController_getStoryStatus","parameters":[{"name":"id","required":true,"in":"path","description":"Story generation request ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Story status retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoryProgressDto"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Story not found"}},"security":[{"firebase-token":[]}],"summary":"Get story generation status","tags":["AI Stories"]}},"/ai-stories/{id}":{"get":{"description":"Retrieve detailed information about a specific story.","operationId":"AiStoriesController_getStory","parameters":[{"name":"id","required":true,"in":"path","description":"Story ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Story details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoryResponseDto"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Story not found"}},"security":[{"firebase-token":[]}],"summary":"Get story details","tags":["AI Stories"]}},"/ai/chat":{"get":{"operationId":"AiController_getHistory","parameters":[],"responses":{"200":{"description":"Returns chat history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatHistoryDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Get chat history","tags":["AI"]}},"/ai/chat/stream":{"get":{"description":"Stream chat messages","operationId":"AiController_streamChat","parameters":[{"name":"message","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Returns stream of chat responses","content":{"text/event-stream":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["abort","textResponseChunk"]},"textResponse":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"chunk":{"type":"string"}}}},"close":{"type":"boolean"},"error":{"type":"string","nullable":true}}}}}}},"security":[{"firebase-token":[]}],"summary":"Stream chat messages","tags":["AI"]}},"/v2/ai/chat":{"get":{"description":"Retrieve chat history with cursor-based pagination. Messages are returned in descending order (newest first) for easy infinite scroll implementation.","operationId":"AiV2Controller_getHistory","parameters":[{"name":"limit","required":false,"in":"query","description":"Number of messages to fetch (max 50)","schema":{"minimum":1,"maximum":50,"default":20,"type":"number"}},{"name":"cursor","required":false,"in":"query","description":"Cursor for pagination - use the oldest message ID from the previous page","schema":{"type":"string"}}],"responses":{"200":{"description":"Returns paginated chat history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedChatHistoryDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Get paginated chat history","tags":["AI v2"]}},"/v1/feed":{"get":{"operationId":"FeedController_getFeed","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedResponseDto"}}}}},"security":[{"bearer":[]}],"tags":["feed"]}},"/v1/feed/stories":{"get":{"operationId":"FeedController_getStories","parameters":[{"name":"cursor","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedMediaDto"}}}}},"security":[{"bearer":[]}],"tags":["feed"]}},"/v1/feed/favourites":{"get":{"operationId":"FeedController_getFavourites","parameters":[{"name":"type","required":true,"in":"query","schema":{"type":"string"}},{"name":"cursor","required":true,"in":"query","schema":{"type":"string"}},{"name":"babyId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedMediaDto"}}}}},"security":[{"bearer":[]}],"tags":["feed"]}},"/v1/feed/recommended":{"get":{"operationId":"FeedController_getRecommended","parameters":[{"name":"cursor","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedMediaDto"}}}}},"security":[{"bearer":[]}],"tags":["feed"]}},"/v1/feed/by-type":{"get":{"operationId":"FeedController_getByType","parameters":[{"name":"type","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedMediaDto"}}}}},"security":[{"bearer":[]}],"tags":["feed"]}},"/v1/feed/by-category":{"get":{"operationId":"FeedController_getCategoriesWithMedia","parameters":[{"name":"type","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Categories with up to 8 media items each, filtered by type if provided","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FeedCategoryWithMediaDto"}}}}}},"security":[{"bearer":[]}],"tags":["feed"]}},"/user/profile":{"post":{"operationId":"UserController_createUserProfile","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserProfileDto"}}}},"responses":{"201":{"description":"User profile created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileResponseDto"}}}},"403":{"description":"Forbidden - Can only create profile for your own user ID"},"409":{"description":"User profile already exists"}},"security":[{"firebase-token":[]}],"summary":"Create a new user profile","tags":["User"]},"get":{"operationId":"UserController_getUserProfile","parameters":[{"name":"userId","required":true,"in":"path","description":"User ID","schema":{}}],"responses":{"200":{"description":"Returns the user profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileResponseDto"}}}},"403":{"description":"Forbidden - Can only access your own profile"},"404":{"description":"User profile not found"}},"security":[{"firebase-token":[]}],"summary":"Get a user profile by userId","tags":["User"]},"put":{"operationId":"UserController_updateUserProfile","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserProfileDto"}}}},"responses":{"200":{"description":"User profile updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileResponseDto"}}}},"403":{"description":"Forbidden - Can only update your own profile"},"404":{"description":"User profile not found"}},"security":[{"firebase-token":[]}],"summary":"Update a user profile","tags":["User"]}},"/user/profile/completion":{"get":{"operationId":"UserController_getProfileCompletion","parameters":[],"responses":{"200":{"description":"Returns the profile completion progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileCompletionDto"}}}},"403":{"description":"Forbidden - Can only access your own profile completion"},"404":{"description":"User profile not found"}},"security":[{"firebase-token":[]}],"summary":"Get user profile completion progress","tags":["User"]}},"/user/babies":{"post":{"operationId":"UserController_createBabyForUser","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBabyDto"}}}},"responses":{"201":{"description":"Baby created successfully and associated with user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserBabyResponseDto"}}}},"404":{"description":"User profile not found"}},"security":[{"firebase-token":[]}],"summary":"Create a new baby and associate it with current user","tags":["User"]},"get":{"operationId":"UserController_getUserBabies","parameters":[],"responses":{"200":{"description":"Returns the list of babies associated with the user","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserBabyResponseDto"}}}}},"403":{"description":"Forbidden - Can only access babies for your own profile"}},"security":[{"firebase-token":[]}],"summary":"Get all babies associated with a user","tags":["User"]}},"/user/babies/{babyId}":{"get":{"operationId":"UserController_getBaby","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Returns the baby information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BabyResponseDto"}}}},"403":{"description":"Forbidden - Baby not associated with your profile"},"404":{"description":"Baby not found"}},"security":[{"firebase-token":[]}],"summary":"Get a baby by ID","tags":["User"]},"put":{"operationId":"UserController_updateBaby","parameters":[{"name":"babyId","required":true,"in":"path","description":"Baby ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBabyDto"}}}},"responses":{"200":{"description":"Baby updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BabyResponseDto"}}}},"403":{"description":"Forbidden - Baby not associated with your profile"},"404":{"description":"Baby not found"}},"security":[{"firebase-token":[]}],"summary":"Update a baby","tags":["User"]}},"/user/coparenting/invite":{"post":{"operationId":"UserController_createParentingToken","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateParentingTokenDto"}}}},"responses":{"201":{"description":"Co-parenting invitation created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParentingTokenResponseDto"}}}},"400":{"description":"Bad request - Invalid data or babies not found"},"403":{"description":"Forbidden - Can only create invites for your own profile"}},"security":[{"firebase-token":[]}],"summary":"Create a co-parenting invitation token","tags":["User"]}},"/user/coparenting/validate":{"post":{"operationId":"UserController_validateParentingToken","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateParentingTokenDto"}}}},"responses":{"200":{"description":"Token validated successfully, returns token and baby information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateParentingTokenResponseDto"}}}},"404":{"description":"Invalid or expired token"}},"security":[{"firebase-token":[]}],"summary":"Validate a co-parenting invitation token","tags":["User"]}},"/user/coparenting/accept":{"post":{"operationId":"UserController_acceptCoParentingInvite","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptCoParentingInviteDto"}}}},"responses":{"200":{"description":"Co-parenting invitation accepted successfully, returns created associations","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserBabyResponseDto"}}}}},"403":{"description":"Forbidden - Can only accept invites for your own profile"},"404":{"description":"Invalid token or user profile not found"}},"security":[{"firebase-token":[]}],"summary":"Accept a co-parenting invitation","tags":["User"]}},"/user/hubs":{"get":{"operationId":"UserController_getUserHubs","parameters":[{"name":"babyId","required":false,"in":"query","description":"Optional baby ID to scope hasNewUpdates to the active baby","schema":{"type":"string"}},{"name":"authorization","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"Returns all hubs with enabled status for the user","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserHubResponseDto"}}}}}},"security":[{"firebase-token":[]}],"summary":"Get all hubs with enabled status for current user","tags":["User"]}},"/user/hubs/order":{"put":{"operationId":"UserController_reorderUserHubs","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderUserHubsDto"}}}},"responses":{"204":{"description":"Hub order saved successfully"},"400":{"description":"Hub IDs are duplicated, unknown, or inactive"}},"security":[{"firebase-token":[]}],"summary":"Save the current user's hub order","tags":["User"]}},"/user/hubs/{hubId}":{"patch":{"operationId":"UserController_toggleUserHub","parameters":[{"name":"hubId","required":true,"in":"path","description":"Hub ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToggleUserHubDto"}}}},"responses":{"200":{"description":"Hub toggled successfully"},"404":{"description":"Hub not found"}},"security":[{"firebase-token":[]}],"summary":"Toggle a hub on/off for the current user","tags":["User"]}},"/user/profile/dropdown-options":{"get":{"operationId":"UserController_getProfileDropdownOptions","parameters":[{"name":"language","required":false,"in":"query","description":"Language locale (e.g., en-US, es-ES, fr-FR, de-DE, it-IT)","schema":{"example":"en-US","type":"string"}}],"responses":{"200":{"description":"Returns all dropdown options with values and labels","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileDropdownOptionsDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Get all dropdown options for user and baby profiles","tags":["User"]}},"/user/consents/ai-data-sharing":{"patch":{"description":"Handles accept, decline and later withdrawal. The policy version and timestamp are stamped server side, the client only sends the decision.","operationId":"UserController_updateThirdPartyAiConsent","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThirdPartyAiConsentDto"}}}},"responses":{"200":{"description":"Decision recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThirdPartyAiConsentResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Record the user decision on sharing data with third party AI providers","tags":["User"]}},"/onboarding/chat":{"get":{"operationId":"OnboardingController_getHistory","parameters":[],"responses":{"200":{"description":"Returns chat history"}},"security":[{"firebase-token":[]}],"summary":"Get chat history","tags":["Onboarding"]},"post":{"operationId":"OnboardingController_sendMessage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequestDto"}}}},"responses":{"201":{"description":"Returns chat response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingChatResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Send a chat message (v1)","tags":["Onboarding"]}},"/onboarding/chat/v2":{"post":{"operationId":"OnboardingController_sendMessageV2","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequestDto"}}}},"responses":{"201":{"description":"Returns chat response with new format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingChatResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Send a chat message (v2)","tags":["Onboarding"]}},"/onboarding/chat/v3":{"post":{"operationId":"OnboardingV3Controller_sendMessageV3","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequestDto"}}}},"responses":{"201":{"description":"Returns chat response with dynamic flow logic","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingChatResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Send a chat message (v3 - dynamic flow)","tags":["Onboarding V3"]}},"/onboarding/flow":{"get":{"operationId":"OnboardingFlowController_getFlow","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingFlowResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Get the onboarding flow (backend-owned steps + branching)","tags":["Onboarding Flow"]},"post":{"operationId":"OnboardingFlowController_submitFlow","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitOnboardingFlowDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitOnboardingFlowResponseDto"}}}}},"security":[{"firebase-token":[]}],"summary":"Submit all onboarding answers at once","tags":["Onboarding Flow"]}},"/admin/notifications/conversation-starters/trigger":{"post":{"description":"Trigger conversation starter notifications for testing or immediate sending. Use with caution in production.","operationId":"NotificationsAdminController_triggerConversationStarters","parameters":[{"name":"userType","required":false,"in":"query","description":"Type of users to send notifications to","schema":{"enum":["staff","all"],"type":"string"}},{"name":"staffOnly","required":false,"in":"query","description":"Send only to @bubuapp.ai staff accounts (overrides userType if true)","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Notifications triggered successfully"},"500":{"description":"Failed to trigger notifications"}},"security":[{"firebase-token":[]}],"summary":"Manually trigger conversation starter notifications","tags":["Admin - Notifications"]}},"/admin/notifications/conversation-starters/test-single":{"post":{"description":"Send a test conversation starter notification to a specific user email","operationId":"NotificationsAdminController_testSingleUserNotification","parameters":[{"name":"email","required":true,"in":"query","description":"User email to send test notification to","schema":{"type":"string"}}],"responses":{"200":{"description":"Test notification sent successfully"}},"security":[{"firebase-token":[]}],"summary":"Test conversation starter notification for specific user","tags":["Admin - Notifications"]}},"/v1/events":{"post":{"operationId":"EventsController_ingest","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEventDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["events"]}},"/ui/config":{"get":{"operationId":"UiController_getConfig","parameters":[],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]}],"tags":["Ui"]}},"/ui/library":{"get":{"operationId":"UiController_getLibrary","parameters":[],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]}],"tags":["Ui"]}},"/ui/landing-page":{"get":{"operationId":"UiController_getLandingPage","parameters":[],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]}],"tags":["Ui"]}},"/ui/featured":{"get":{"operationId":"UiController_getFeatured","parameters":[],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]}],"tags":["Ui"]}},"/ui/favorites":{"get":{"operationId":"UiController_getFavorites","parameters":[],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]}],"tags":["Ui"]}},"/ui/recommended":{"get":{"operationId":"UiController_getRecommended","parameters":[],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]}],"tags":["Ui"]}},"/ui/custom-stories":{"get":{"operationId":"UiController_getCustomStories","parameters":[],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]}],"tags":["Ui"]}},"/ui/library/next-page":{"get":{"operationId":"UiController_getLibraryNextPage","parameters":[{"name":"skip","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]}],"tags":["Ui"]}},"/ui/categories/{categoryId}":{"get":{"operationId":"UiController_getCategories","parameters":[{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]}],"tags":["Ui"]}},"/ui/categories/{categoryId}/next-page":{"get":{"operationId":"UiController_getCategoryNextPage","parameters":[{"name":"categoryId","required":true,"in":"path","schema":{"type":"string"}},{"name":"skip","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]}],"tags":["Ui"]}},"/ui/create-story":{"get":{"operationId":"UiController_getCreateStoryPage","parameters":[],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]}],"tags":["Ui"]}},"/ui/media/{mediaId}":{"get":{"operationId":"UiController_getMediaDetailsPage","parameters":[{"name":"mediaId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"firebase-token":[]}],"tags":["Ui"]}}},"info":{"title":"BubuApp API","description":"","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"firebase-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","name":"Authorization","description":"Firebase JWT token for authentication","in":"header"}},"schemas":{"CreateHubDto":{"type":"object","properties":{"name":{"type":"string","description":"Display name, localized to the request language. Not stable — do not match on it."},"description":{"type":"string"},"language":{"type":"string"},"thumbnail_url":{"type":"string"},"status":{"type":"string","enum":["active","inactive","draft"]},"order_index":{"type":"number"},"config_json":{"type":"object"},"isEnabled":{"type":"boolean","description":"Whether the hub is enabled for the current user"},"isAlwaysEnabled":{"type":"boolean","description":"Whether the hub is always enabled (cannot be disabled)"},"hasNewUpdates":{"type":"boolean","description":"Whether the hub has new unseen updates for the current user"}},"required":["name"]},"HubDto":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"slug":{"type":"string","readOnly":true,"example":"sleep","description":"Stable machine identifier. Route and branch on THIS, never on `name` — `name` is localized (the Sleep hub is \"Sonno\" in Italian), so matching it breaks in every non-English locale. Read-only: it is curated data and cannot be changed through the API, so a rename can never re-route the app."},"name":{"type":"string","description":"Display name, localized to the request language. Not stable — do not match on it."},"description":{"type":"string"},"language":{"type":"string"},"thumbnail_url":{"type":"string"},"status":{"type":"string","enum":["active","inactive","draft"]},"order_index":{"type":"number"},"config_json":{"type":"object"},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"isEnabled":{"type":"boolean","description":"Whether the hub is enabled for the current user"},"isAlwaysEnabled":{"type":"boolean","description":"Whether the hub is always enabled (cannot be disabled)"},"hasNewUpdates":{"type":"boolean","description":"Whether the hub has new unseen updates for the current user"}},"required":["name"]},"PaginatedHubsDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/HubDto"}},"skip":{"type":"number"},"take":{"type":"number"},"total":{"type":"number"},"nextCursor":{"type":"string"}},"required":["data","skip","take","total"]},"UpdateHubDto":{"type":"object","properties":{"name":{"type":"string","description":"Display name, localized to the request language. Not stable — do not match on it."},"description":{"type":"string"},"language":{"type":"string"},"thumbnail_url":{"type":"string"},"status":{"type":"string","enum":["active","inactive","draft"]},"order_index":{"type":"number"},"config_json":{"type":"object"},"isEnabled":{"type":"boolean","description":"Whether the hub is enabled for the current user"},"isAlwaysEnabled":{"type":"boolean","description":"Whether the hub is always enabled (cannot be disabled)"},"hasNewUpdates":{"type":"boolean","description":"Whether the hub has new unseen updates for the current user"}}},"IdentityDto":{"type":"object","properties":{"uid":{"type":"string"},"email":{"type":"string"},"email_verified":{"type":"boolean"},"displayName":{"type":"string"},"photoURL":{"type":"string"},"phoneNumber":{"type":"string"},"aud":{"type":"string"},"auth_time":{"type":"number"},"exp":{"type":"number"},"firebase":{"type":"object"},"iat":{"type":"number"},"iss":{"type":"string"},"sub":{"type":"string"}},"required":["uid","email","email_verified","displayName","photoURL","phoneNumber","aud","auth_time","exp","firebase","iat","iss","sub"]},"SendEmailSignInLinkDto":{"type":"object","properties":{"email":{"type":"string","description":"Email address that should receive the Firebase sign-in link","example":"parent@example.com"},"language":{"type":"string","description":"Preferred email language/locale","example":"en-US"}},"required":["email"]},"SendEmailSignInLinkResponseDto":{"type":"object","properties":{"sent":{"type":"boolean"},"email":{"type":"string"},"nextAction":{"type":"string","enum":["CHECK_EMAIL"]}},"required":["sent","email","nextAction"]},"HubUpdateResultResponseDto":{"type":"object","properties":{"success":{"type":"boolean"},"result":{"oneOf":[{"$ref":"#/components/schemas/QuizResultDto"},{"$ref":"#/components/schemas/SurveyResultDto"}]}},"required":["success","result"]},"QuizScoreDto":{"type":"object","properties":{"correct":{"type":"number"},"total":{"type":"number"},"percentage":{"type":"number"}},"required":["correct","total","percentage"]},"QuizReviewItemDto":{"type":"object","properties":{"questionId":{"type":"string"},"selectedOptionIds":{"type":"array","items":{"type":"string"}},"correctOptionId":{"type":"string","nullable":true},"correctOptionIds":{"type":"array","items":{"type":"string"}},"numericValue":{"type":"number"},"correctMinValue":{"type":"number"},"correctMaxValue":{"type":"number"},"isCorrect":{"type":"boolean"},"explanation":{"type":"string","nullable":true}},"required":["questionId","selectedOptionIds","isCorrect"]},"QuizResultDto":{"type":"object","properties":{"type":{"type":"string","enum":["quiz_result"]},"title":{"type":"string"},"subtitle":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"score":{"$ref":"#/components/schemas/QuizScoreDto"},"review":{"type":"array","items":{"$ref":"#/components/schemas/QuizReviewItemDto"}},"next_action_label":{"type":"string","nullable":true},"next_action_description":{"type":"string","nullable":true}},"required":["type","title","score","review"]},"SurveyResultDto":{"type":"object","properties":{"type":{"type":"string","enum":["survey_result"]},"profile_id":{"type":"string","nullable":true},"title":{"type":"string"},"subtitle":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"tips":{"type":"array","items":{"type":"string"}},"scores":{"type":"object","additionalProperties":{"type":"number"}},"next_action_label":{"type":"string","nullable":true},"next_action_description":{"type":"string","nullable":true}},"required":["type","title"]},"TimestampsDto":{"type":"object","properties":{"created_at":{"format":"date-time","type":"string"},"expires_at":{"format":"date-time","type":"string"},"seen_at":{"format":"date-time","type":"string"},"acted_at":{"format":"date-time","type":"string"}},"required":["created_at"]},"ActionDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"},"target":{"type":"string"},"payload":{"type":"object"}},"required":["id","label","type","target"]},"HubUpdateActionStateDto":{"type":"object","properties":{"reaction":{"type":"string","enum":["LIKE","DISLIKE"],"nullable":true},"saved":{"type":"boolean"}},"required":["saved"]},"TipSectionDto":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"icon":{"type":"string"}},"required":["id","title","body"]},"FileDto":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","example":"https://firebasestorage.googleapis.com/v0/b/bubu-app-io.firebasestorage.app/o/media%2F1737929809620_fan-on-high-speed.mp3?alt=media"},"path":{"type":"string"},"bucket":{"type":"string"},"previewUrl":{"type":"string"},"fileType":{"type":"string"},"bitrate":{"type":"number"},"duration":{"type":"number"},"resolution":{"type":"string"},"uploadDate":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"mediaId":{"type":"string"}},"required":["id","url","path","bucket","duration","uploadDate","createdAt","updatedAt"]},"TagDto":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"language":{"type":"string"}},"required":["name"]},"MediaCategoryDto":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"}},"required":["name"]},"CustomStoryMetadataDto":{"type":"object","properties":{"story_vibe":{"type":"string"},"story_plot":{"type":"string"},"lesson_message":{"type":"string"},"narrator_style":{"type":"string"},"personal_touch":{"type":"string"}}},"MediaDto":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"title":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string"},"lyrics":{"type":"string"},"type":{"type":"string"},"artist":{"type":"string","readOnly":true},"language":{"type":"string"},"createdAt":{"format":"date-time","type":"string","readOnly":true},"updatedAt":{"format":"date-time","type":"string","readOnly":true},"files":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/FileDto"}},"tags":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/TagDto"}},"categories":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/MediaCategoryDto"}},"plays":{"type":"number","readOnly":true},"featured":{"type":"boolean"},"userFavorite":{"type":"boolean","readOnly":true},"userFeedback":{"type":"number","readOnly":true},"userProgress":{"type":"number","readOnly":true},"customStoryMetadata":{"$ref":"#/components/schemas/CustomStoryMetadataDto"}},"required":["title","slug","description","lyrics","type"]},"ArticleSectionDto":{"type":"object","properties":{"id":{"type":"string"},"heading":{"type":"string"},"body":{"type":"string"}},"required":["id","heading","body"]},"ArticleDto":{"type":"object","properties":{"sections":{"description":"Structured article sections. Article bodies must live here, not attributes.sections.","type":"array","items":{"$ref":"#/components/schemas/ArticleSectionDto"}}}},"QuestionOptionDto":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"string"},"label":{"type":"string","description":"Label text"},"orderIndex":{"type":"number"}},"required":["id","value","label","orderIndex"]},"QuestionDto":{"type":"object","properties":{"id":{"type":"string"},"questionId":{"type":"string"},"question":{"type":"string","description":"Question text"},"type":{"type":"string","enum":["SINGLE_CHOICE","MULTI_CHOICE","BOOLEAN","NUMBER","SLIDER","TEXT","TIME","DATE"]},"isRequired":{"type":"boolean"},"orderIndex":{"type":"number"},"unit":{"type":"string"},"min_value":{"type":"number","description":"Minimum value for SLIDER questions"},"max_value":{"type":"number","description":"Maximum value for SLIDER questions"},"step":{"type":"number","description":"Step value for SLIDER questions"},"min_label":{"type":"string","description":"Minimum label for SLIDER questions"},"mid_label":{"type":"string","description":"Middle label for SLIDER questions"},"max_label":{"type":"string","description":"Maximum label for SLIDER questions"},"options":{"type":"array","items":{"$ref":"#/components/schemas/QuestionOptionDto"}},"correctOptionId":{"type":"string","description":"ID of the correct option (for quiz questions)"},"correct_option_ids":{"description":"Correct option IDs for MULTI_CHOICE quiz questions","type":"array","items":{"type":"string"}},"correct_min_value":{"type":"number","description":"Minimum correct numeric value for SLIDER quiz questions"},"correct_max_value":{"type":"number","description":"Maximum correct numeric value for SLIDER quiz questions"},"profile_weights_by_value":{"type":"object","description":"Survey result weights keyed by slider value"},"correctBoolean":{"type":"boolean","description":"Correct boolean value for true/false quiz questions"},"explanation":{"type":"string","description":"Explanation shown after answering"}},"required":["id","question","type","isRequired","orderIndex"]},"QuestionnaireDto":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","description":"Questionnaire title"},"subtitle":{"type":"string","description":"Questionnaire subtitle"},"description":{"type":"string","description":"Questionnaire description"},"type":{"type":"string"},"target_domain":{"type":"string"},"version":{"type":"number"},"questions":{"type":"array","items":{"$ref":"#/components/schemas/QuestionDto"}},"result_logic":{"type":"object","description":"Optional raw result logic/configuration for quiz evaluation"}},"required":["id","title","type","version","questions"]},"UserAnswerDto":{"type":"object","properties":{"questionId":{"type":"string","description":"Question ID"},"answerType":{"type":"string","description":"Answer type from the question"},"answerValue":{"type":"object","description":"The actual answer value"},"answeredAt":{"format":"date-time","type":"string","description":"When the answer was submitted"}},"required":["questionId","answerType","answerValue","answeredAt"]},"AttributesDto":{"type":"object","properties":{"image_url":{"type":"string"},"target_url":{"type":"string"},"sections":{"description":"Optional structured sections for TIPS-style updates","type":"array","items":{"$ref":"#/components/schemas/TipSectionDto"}},"media":{"$ref":"#/components/schemas/MediaDto"},"article":{"$ref":"#/components/schemas/ArticleDto"},"questionnaire":{"$ref":"#/components/schemas/QuestionnaireDto"},"user_answers":{"description":"User submitted answers for the questionnaire","type":"array","items":{"$ref":"#/components/schemas/UserAnswerDto"}},"result":{"description":"Calculated result for a completed quiz or survey, rebuilt from user_answers in the request language","oneOf":[{"$ref":"#/components/schemas/QuizResultDto"},{"$ref":"#/components/schemas/SurveyResultDto"}],"discriminator":{"propertyName":"type","mapping":{"quiz_result":"#/components/schemas/QuizResultDto","survey_result":"#/components/schemas/SurveyResultDto"}}},"message_content":{"type":"string"}}},"HubUpdateDto":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"type":{"type":"string","enum":["article","tips","quiz","profile_survey","media_audio_lesson","media_video","media_image","media_podcast"]},"title":{"type":"string"},"subtitle":{"type":"string"},"description":{"type":"string"},"hint":{"type":"string"},"status":{"type":"string","enum":["NEW","SEEN","ACTED","EXPIRED"]},"priority":{"type":"string","enum":["LOW","NORMAL","HIGH","URGENT"]},"severity":{"type":"string","enum":["INFO","WARNING","CRITICAL"]},"timestamps":{"$ref":"#/components/schemas/TimestampsDto"},"tags":{"type":"array","items":{"type":"string"}},"actions":{"type":"array","items":{"$ref":"#/components/schemas/ActionDto"}},"show_reaction":{"type":"boolean"},"show_save":{"type":"boolean"},"action_state":{"$ref":"#/components/schemas/HubUpdateActionStateDto"},"baby_id":{"type":"string"},"attributes":{"$ref":"#/components/schemas/AttributesDto"},"locale":{"type":"string"}},"required":["id","agent_id","type","title","status","priority","severity","timestamps","tags","show_reaction","show_save","baby_id"]},"HubUpdatesResponseDto":{"type":"object","properties":{"batch_id":{"type":"string"},"user_id":{"type":"string"},"locale":{"type":"string"},"generated_at":{"format":"date-time","type":"string"},"updates":{"type":"array","items":{"$ref":"#/components/schemas/HubUpdateDto"}}},"required":["batch_id","user_id","locale","generated_at","updates"]},"HubUpdateReactionRequestDto":{"type":"object","properties":{"reaction":{"type":"string","enum":["LIKE","DISLIKE"],"nullable":true}},"required":["reaction"]},"HubUpdateSaveRequestDto":{"type":"object","properties":{"saved":{"type":"boolean"}},"required":["saved"]},"HubUpdateResultAnswerDto":{"type":"object","properties":{"questionId":{"type":"string"},"selectedOptionIds":{"type":"array","items":{"type":"string"}},"value":{"type":"number","description":"Numeric value for SLIDER questions"}},"required":["questionId"]},"HubUpdateResultRequestDto":{"type":"object","properties":{"babyId":{"type":"string"},"answers":{"type":"array","items":{"$ref":"#/components/schemas/HubUpdateResultAnswerDto"}}},"required":["answers"]},"RoleOptionDto":{"type":"object","properties":{"displayName":{"type":"string","description":"Localized display name for the option"},"value":{"type":"string","description":"Enum value to send back to the API"}},"required":["displayName","value"]},"RoleWithRelationshipsDto":{"type":"object","properties":{"role":{"description":"The role","allOf":[{"$ref":"#/components/schemas/RoleOptionDto"}]},"relationshipTypes":{"description":"Available relationship types for this role","type":"array","items":{"$ref":"#/components/schemas/RoleOptionDto"}}},"required":["role","relationshipTypes"]},"GetRolesResponseDto":{"type":"object","properties":{"roles":{"description":"Available roles with their relationship types","type":"array","items":{"$ref":"#/components/schemas/RoleWithRelationshipsDto"}}},"required":["roles"]},"BabyDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"birthday":{"type":"string"},"gender":{"type":"string"},"isPremature":{"type":"boolean"},"isFirstChild":{"type":"boolean"},"profilePictureUrl":{"type":"string"},"myRole":{"type":"string","enum":["OWNER","CO_PARENT","EXTENDED_FAMILY","CAREGIVER"]},"myRelationshipType":{"type":"string","enum":["MOTHER","FATHER","STEP_MOTHER","STEP_FATHER","GRANDMOTHER","GRANDFATHER","AUNT","UNCLE","SIBLING","NANNY","BABYSITTER","DAYCARE_TEACHER","FAMILY_FRIEND","OTHER"]},"teamSize":{"type":"number"}},"required":["id","name","myRole","teamSize"]},"GetMyBabiesResponseDto":{"type":"object","properties":{"babies":{"type":"array","items":{"$ref":"#/components/schemas/BabyDto"}}},"required":["babies"]},"TeamMemberDto":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"profilePictureUrl":{"type":"string"},"role":{"type":"string","enum":["OWNER","CO_PARENT","EXTENDED_FAMILY","CAREGIVER"]},"relationshipType":{"type":"string","enum":["MOTHER","FATHER","STEP_MOTHER","STEP_FATHER","GRANDMOTHER","GRANDFATHER","AUNT","UNCLE","SIBLING","NANNY","BABYSITTER","DAYCARE_TEACHER","FAMILY_FRIEND","OTHER"]},"joinedAt":{"format":"date-time","type":"string"},"canRemove":{"type":"boolean"},"canChangeRole":{"type":"boolean"}},"required":["userId","name","role","joinedAt","canRemove","canChangeRole"]},"PendingInvitationDto":{"type":"object","properties":{"id":{"type":"string"},"invitedEmail":{"type":"string"},"role":{"type":"string","enum":["OWNER","CO_PARENT","EXTENDED_FAMILY","CAREGIVER"]},"sentBy":{"type":"string"},"sentAt":{"format":"date-time","type":"string"},"expiresAt":{"format":"date-time","type":"string"}},"required":["id","role","sentBy","sentAt","expiresAt"]},"GetTeamMembersResponseDto":{"type":"object","properties":{"babyId":{"type":"string"},"members":{"type":"array","items":{"$ref":"#/components/schemas/TeamMemberDto"}},"pendingInvitations":{"type":"array","items":{"$ref":"#/components/schemas/PendingInvitationDto"}}},"required":["babyId","members","pendingInvitations"]},"InviteMemberDto":{"type":"object","properties":{"role":{"type":"string","enum":["OWNER","CO_PARENT","EXTENDED_FAMILY","CAREGIVER"]},"relationshipType":{"type":"string","enum":["MOTHER","FATHER","STEP_MOTHER","STEP_FATHER","GRANDMOTHER","GRANDFATHER","AUNT","UNCLE","SIBLING","NANNY","BABYSITTER","DAYCARE_TEACHER","FAMILY_FRIEND","OTHER"]},"email":{"type":"string"},"phone":{"type":"string"}},"required":["role"]},"InviteMemberResponseDto":{"type":"object","properties":{"invitationId":{"type":"string"},"code":{"type":"string"},"shareUrl":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"}},"required":["invitationId","code","shareUrl","expiresAt"]},"BabyResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier","readOnly":true},"name":{"type":"string","description":"Baby name","example":"Emma"},"isPremature":{"type":"boolean","description":"Whether the baby was born prematurely"},"isFirstChild":{"type":"boolean","description":"Whether this is the first-born child"},"birthDate":{"format":"date-time","type":"string","description":"Baby's birth date"},"gender":{"type":"string","description":"Baby's gender","example":"female"},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp","readOnly":true},"updatedAt":{"format":"date-time","type":"string","description":"Last update timestamp","readOnly":true},"mainPainPoint":{"type":"string","description":"Baby's main pain point or concern","example":"Sleep regression"},"profilePictureUrl":{"type":"string","description":"Baby's profile picture URL","example":"https://storage.googleapis.com/bucket/baby-profile.jpg"}},"required":["id","createdAt","updatedAt"]},"CreateBabyDto":{"type":"object","properties":{"name":{"type":"string","description":"Baby name","example":"Emma"},"isPremature":{"type":"boolean","description":"Whether the baby was born prematurely","example":false},"isFirstChild":{"type":"boolean","description":"Whether this is the first child","example":true},"birthDate":{"format":"date-time","type":"string","description":"Baby's birth date"},"gender":{"type":"string","description":"Baby's gender","example":"female"},"mainPainPoint":{"type":"string","description":"Baby's main pain point or concern","example":"Sleep regression"},"profilePictureUrl":{"type":"string","description":"Baby's profile picture URL","example":"https://storage.googleapis.com/bucket/baby-profile.jpg"}}},"UpdateBabyDto":{"type":"object","properties":{"name":{"type":"string","description":"Baby name","example":"Emma"},"isPremature":{"type":"boolean","description":"Whether the baby was born prematurely","example":false},"isFirstChild":{"type":"boolean","description":"Whether this is the first-born child","example":true},"birthDate":{"format":"date-time","type":"string","description":"Baby's birth date"},"gender":{"type":"string","description":"Baby's gender","example":"female"},"mainPainPoint":{"type":"string","description":"Baby's main pain point or concern","example":"Sleep regression"},"profilePictureUrl":{"type":"string","description":"Baby's profile picture URL","example":"https://storage.googleapis.com/bucket/baby-profile.jpg"}}},"CarePlanScheduleDto":{"type":"object","properties":{"daysOfWeek":{"description":"Days the routine applies to. 0 = Sunday .. 6 = Saturday.","example":[0,1,2,3,4,5,6],"type":"array","items":{"type":"string"}},"startMinutes":{"type":"number","description":"Routine start, minutes after local midnight.","example":1125}},"required":["daysOfWeek","startMinutes"]},"CarePlanStepDto":{"type":"object","properties":{"key":{"type":"string","description":"Stable key, lowercase snake_case.","example":"warm_bath"},"label":{"type":"string","example":"Warm bath"},"offsetMinutes":{"type":"number","description":"Minutes after the routine start time.","example":0},"icon":{"type":"string","example":"bath"},"owner":{"type":"string","enum":["PARENT","BUBU"],"default":"PARENT","description":"Who performs this step. BUBU marks the ones Bubu records from the logs, so the UI can show them without a tick box."}},"required":["key","label","offsetMinutes"]},"CarePlanDefinitionDto":{"type":"object","properties":{"goal":{"type":"string","example":"Longer first stretch"},"targetNights":{"type":"number","description":"Length of the programme in scheduled nights, for \"Night 2 of 7\". Omit for an open-ended routine.","example":7},"schedule":{"$ref":"#/components/schemas/CarePlanScheduleDto"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/CarePlanStepDto"}}},"required":["schedule","steps"]},"CarePlanResponseDto":{"type":"object","properties":{"id":{"type":"string"},"babyId":{"type":"string"},"hubId":{"type":"string"},"planTypeKey":{"type":"string","example":"routine"},"status":{"type":"string","enum":["ACTIVE","PAUSED","COMPLETED","ARCHIVED"]},"timezone":{"type":"string","example":"Europe/Madrid"},"version":{"type":"number","example":3},"effectiveFrom":{"type":"string","description":"Civil date this version starts applying.","example":"2026-07-27"},"reviewOn":{"type":"string","nullable":true,"description":"Civil date to review how it went.","example":"2026-08-03"},"definition":{"$ref":"#/components/schemas/CarePlanDefinitionDto"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","babyId","hubId","planTypeKey","status","timezone","version","effectiveFrom","definition","createdAt","updatedAt"]},"CreateCarePlanDto":{"type":"object","properties":{"hubId":{"type":"string","description":"Hub this plan belongs to."},"planTypeKey":{"type":"string","description":"Distinguishes concurrent plans within one hub.","default":"routine"},"effectiveFrom":{"type":"string","description":"Civil date the plan starts applying. Defaults to today in the plan timezone.","example":"2026-07-28"},"definition":{"$ref":"#/components/schemas/CarePlanDefinitionDto"},"reviewOn":{"type":"string","description":"Civil date to review how the plan went.","example":"2026-08-03"}},"required":["hubId","definition"]},"CareStepSearchResultDto":{"type":"object","properties":{"key":{"type":"string","example":"warm_bath"},"label":{"type":"string","description":"Curated labels come back localized; your own steps come back as written.","example":"Warm bath"},"icon":{"type":"string","nullable":true},"source":{"type":"string","enum":["curated","yours"],"description":"'yours' marks a step this family added themselves."}},"required":["key","label","source"]},"CarePlanProposalResponseDto":{"type":"object","properties":{"id":{"type":"string"},"babyId":{"type":"string"},"hubId":{"type":"string"},"planTypeKey":{"type":"string","example":"routine"},"planId":{"type":"string","nullable":true,"description":"Plan this suggestion changes; null when it proposes a first plan."},"baseVersion":{"type":"number","nullable":true,"description":"Plan version the suggestion was built against."},"definition":{"$ref":"#/components/schemas/CarePlanDefinitionDto"},"rationale":{"type":"string","nullable":true},"status":{"type":"string","enum":["PENDING","ACCEPTED","DECLINED","EXPIRED","SUPERSEDED","WITHDRAWN"]},"revision":{"type":"number","description":"Bumped by each parent edit; send back as baseRevision."},"editedAt":{"format":"date-time","type":"string","nullable":true},"expiresAt":{"format":"date-time","type":"string"},"respondedAt":{"format":"date-time","type":"string","nullable":true},"createdAt":{"format":"date-time","type":"string"}},"required":["id","babyId","hubId","planTypeKey","definition","status","revision","expiresAt","createdAt"]},"EditCarePlanProposalDto":{"type":"object","properties":{"baseRevision":{"type":"number","description":"Revision the edit was made against. Rejected if stale."},"definition":{"$ref":"#/components/schemas/CarePlanDefinitionDto"}},"required":["baseRevision","definition"]},"CarePlanProposalDecisionResponseDto":{"type":"object","properties":{"proposal":{"$ref":"#/components/schemas/CarePlanProposalResponseDto"},"plan":{"nullable":true,"description":"The resulting plan. Null when the proposal was declined.","allOf":[{"$ref":"#/components/schemas/CarePlanResponseDto"}]}},"required":["proposal"]},"UpdateCarePlanDto":{"type":"object","properties":{"baseVersion":{"type":"number","description":"Version the edit was made against. Rejected if stale."},"effectiveFrom":{"type":"string","description":"Civil date the new version starts applying."},"summary":{"type":"string","description":"Short description of what changed."},"status":{"type":"string","enum":["ACTIVE","PAUSED","COMPLETED","ARCHIVED"]},"definition":{"$ref":"#/components/schemas/CarePlanDefinitionDto"},"reviewOn":{"type":"string","description":"Civil date to review how the plan went.","example":"2026-08-03"}},"required":["baseVersion"]},"CarePlanCheckInResponseDto":{"type":"object","properties":{"id":{"type":"string"},"planId":{"type":"string"},"localDate":{"type":"string","example":"2026-07-27"},"planVersion":{"type":"number"},"stepKey":{"type":"string","example":"@routine"},"status":{"type":"string","enum":["DONE","PARTLY","NOT_DONE","NOT_APPLICABLE"]},"actualAt":{"format":"date-time","type":"string","nullable":true},"source":{"type":"string","enum":["PARENT","COMPANION","NURSERY","SYSTEM"]},"note":{"type":"string","nullable":true},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","planId","localDate","planVersion","stepKey","status","source","createdAt","updatedAt"]},"CarePlanDayEntryDto":{"type":"object","properties":{"status":{"type":"string","enum":["DONE","PARTLY","NOT_DONE","NOT_APPLICABLE","UNKNOWN"]},"checkIn":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/CarePlanCheckInResponseDto"}]}},"required":["status"]},"CarePlanDayStepDto":{"type":"object","properties":{"key":{"type":"string","example":"warm_bath"},"label":{"type":"string","example":"Warm bath"},"icon":{"type":"string","nullable":true},"at":{"type":"string","description":"Local clock time, HH:MM.","example":"18:45"},"checkIn":{"$ref":"#/components/schemas/CarePlanDayEntryDto"}},"required":["key","label","at","checkIn"]},"CarePlanDayDto":{"type":"object","properties":{"date":{"type":"string","example":"2026-07-27"},"nightIndex":{"type":"number","description":"1-based index among the plan's scheduled days, for \"Night 2 of 7\".","example":2},"planVersion":{"type":"number","description":"Plan version in force on this date."},"routine":{"description":"The whole-routine answer.","allOf":[{"$ref":"#/components/schemas/CarePlanDayEntryDto"}]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/CarePlanDayStepDto"}}},"required":["date","nightIndex","planVersion","routine","steps"]},"CarePlanDaysResponseDto":{"type":"object","properties":{"planId":{"type":"string"},"timezone":{"type":"string","example":"Europe/Madrid"},"targetNights":{"type":"number","nullable":true,"description":"Programme length in scheduled nights; null for an open-ended routine.","example":7},"days":{"description":"Only dates the routine actually applies to. Non-scheduled days are omitted.","type":"array","items":{"$ref":"#/components/schemas/CarePlanDayDto"}}},"required":["planId","timezone","days"]},"UpsertCheckInDto":{"type":"object","properties":{"localDate":{"type":"string","description":"The plan-day this answers, as a civil date.","example":"2026-07-27"},"stepKey":{"type":"string","description":"Step this answers. Omit (or send \"@routine\") for the whole routine.","default":"@routine"},"status":{"type":"string","enum":["DONE","PARTLY","NOT_DONE","NOT_APPLICABLE"]},"actualAt":{"type":"string","description":"Optional time the parent reported this actually happened. Never inferred from the plan."},"note":{"type":"string"}},"required":["localDate","status"]},"CompanionPromptDto":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"actionId":{"type":"string","enum":["open_companion"]},"topicKey":{"type":"string"},"agentType":{"type":"string","enum":["companion","sleep_companion"]},"expiresAt":{"format":"date-time","type":"string"}},"required":["id","text","actionId","topicKey","agentType","expiresAt"]},"CompanionPromptCurrentResponseDto":{"type":"object","properties":{"prompt":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/CompanionPromptDto"}]},"generationPending":{"type":"boolean","description":"True when generation was queued because no current prompt existed"}},"required":["generationPending"]},"AcceptInvitationDto":{"type":"object","properties":{"code":{"type":"string","description":"Invitation code"}},"required":["code"]},"AcceptInvitationResponseDto":{"type":"object","properties":{"babyId":{"type":"string"},"babyName":{"type":"string"},"role":{"type":"string"},"relationshipType":{"type":"string","enum":["MOTHER","FATHER","STEP_MOTHER","STEP_FATHER","GRANDMOTHER","GRANDFATHER","AUNT","UNCLE","SIBLING","NANNY","BABYSITTER","DAYCARE_TEACHER","FAMILY_FRIEND","OTHER"]},"message":{"type":"string"}},"required":["babyId","babyName","role","message"]},"DeclineInvitationDto":{"type":"object","properties":{"code":{"type":"string","description":"Invitation code"}},"required":["code"]},"DeclineInvitationResponseDto":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"CancelInvitationResponseDto":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"UserLookupDto":{"type":"object","properties":{"email":{"type":"string","description":"Email address to search for"},"phone":{"type":"string","description":"Phone number to search for"}}},"LookupUserDto":{"type":"object","properties":{"userId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"}},"required":["userId"]},"LookupBabyDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"birthDate":{"type":"string"},"gender":{"type":"string"},"hasNursery":{"type":"boolean","description":"Whether baby is already enrolled in a nursery"}},"required":["id","hasNursery"]},"UserLookupResponseDto":{"type":"object","properties":{"found":{"type":"boolean"},"user":{"$ref":"#/components/schemas/LookupUserDto"},"babies":{"type":"array","items":{"$ref":"#/components/schemas/LookupBabyDto"}}},"required":["found","babies"]},"OnboardBabyDto":{"type":"object","properties":{"name":{"type":"string","description":"Baby name"},"birthDate":{"type":"string","description":"Baby birth date (ISO date string)"},"gender":{"type":"string","description":"Baby gender","enum":["male","female","other"]},"allergies":{"description":"List of allergies","type":"array","items":{"type":"string"}},"medicalConditions":{"description":"List of medical conditions","type":"array","items":{"type":"string"}}},"required":["name"]},"OnboardParentDto":{"type":"object","properties":{"email":{"type":"string","description":"Parent email address"},"phone":{"type":"string","description":"Parent phone number"},"firstName":{"type":"string","description":"Parent first name"},"lastName":{"type":"string","description":"Parent last name"},"relationshipType":{"type":"string","description":"Relationship type to baby","enum":["MOTHER","FATHER","STEP_MOTHER","STEP_FATHER","GRANDMOTHER","GRANDFATHER","AUNT","UNCLE","SIBLING","NANNY","BABYSITTER","DAYCARE_TEACHER","FAMILY_FRIEND","OTHER"]}},"required":["relationshipType"]},"OnboardNurseryContextDto":{"type":"object","properties":{"nurseryId":{"type":"string","description":"External nursery ID from nursery system"},"nurseryName":{"type":"string","description":"Nursery name for display in invitation"},"nurseryLogoUrl":{"type":"string","description":"Public URL to the nursery's logo, shown in the welcome email"}},"required":["nurseryId","nurseryName"]},"NurseryOnboardDto":{"type":"object","properties":{"userId":{"type":"string","description":"Existing BubuApp user ID. If provided, skips user creation and links baby to this user."},"baby":{"description":"Baby information","allOf":[{"$ref":"#/components/schemas/OnboardBabyDto"}]},"parent":{"description":"Parent information. Required if userId is not provided.","allOf":[{"$ref":"#/components/schemas/OnboardParentDto"}]},"nursery":{"description":"Nursery context","allOf":[{"$ref":"#/components/schemas/OnboardNurseryContextDto"}]},"sendInvitation":{"type":"boolean","description":"Whether to send automatic parent onboarding notifications. When false, suppresses both email and push.","default":true},"parentInvitationCode":{"type":"string","description":"Nursery parent invitation code to include in the welcome email"},"language":{"type":"string","description":"Preferred locale for nursery communications (e.g. en-US, es-ES, fr-FR)"}},"required":["baby","nursery"]},"OnboardBabyResponseDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"OnboardUserResponseDto":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"isExisting":{"type":"boolean","description":"Whether this is an existing user or newly created"},"createdFrom":{"type":"string","description":"Where the user was created from (only for new users)"}},"required":["userId","isExisting"]},"OnboardInvitationResponseDto":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"expiresAt":{"type":"string"}},"required":["id","code","expiresAt"]},"OnboardCareTeamResponseDto":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"}},"required":["id","role"]},"NurseryOnboardNotificationResponseDto":{"type":"object","properties":{"emailStatus":{"type":"string","description":"Email delivery status for the automatic onboarding notification"},"pushStatus":{"type":"string","description":"Push delivery status for the automatic onboarding notification"},"errorMessage":{"type":"string"}},"required":["emailStatus","pushStatus"]},"NurseryOnboardResponseDto":{"type":"object","properties":{"baby":{"$ref":"#/components/schemas/OnboardBabyResponseDto"},"user":{"$ref":"#/components/schemas/OnboardUserResponseDto"},"invitation":{"$ref":"#/components/schemas/OnboardInvitationResponseDto"},"careTeam":{"$ref":"#/components/schemas/OnboardCareTeamResponseDto"},"notification":{"$ref":"#/components/schemas/NurseryOnboardNotificationResponseDto"}},"required":["baby","user","careTeam"]},"CareTeamMemberDto":{"type":"object","properties":{"email":{"type":"string","description":"Member email address"},"phone":{"type":"string","description":"Member phone number (E.164 format)"},"firstName":{"type":"string","description":"Member first name"},"lastName":{"type":"string","description":"Member last name"},"role":{"type":"string","description":"Care team role","enum":["CO_PARENT"]},"relationshipType":{"type":"string","description":"Relationship type to baby","enum":["MOTHER","FATHER","STEP_MOTHER","STEP_FATHER","GRANDMOTHER","GRANDFATHER","AUNT","UNCLE","SIBLING","NANNY","BABYSITTER","DAYCARE_TEACHER","FAMILY_FRIEND","OTHER"]}},"required":["role"]},"AddCareTeamMemberDto":{"type":"object","properties":{"babyId":{"type":"string","description":"Baby ID to add care team member for"},"member":{"description":"Care team member info","allOf":[{"$ref":"#/components/schemas/CareTeamMemberDto"}]},"nurseryName":{"type":"string","description":"Nursery name (used in welcome email)"},"nurseryLogoUrl":{"type":"string","description":"Public URL to the nursery's logo, shown in the welcome email"},"sendInvitation":{"type":"boolean","description":"Whether to send automatic onboarding notifications. When false, suppresses both email and push.","default":true},"language":{"type":"string","description":"Preferred locale for nursery communications (e.g. en-US, es-ES, fr-FR)"}},"required":["babyId","member"]},"AddCareTeamMemberUserResponseDto":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"}},"required":["userId"]},"AddCareTeamMemberInvitationResponseDto":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"role":{"type":"string"},"relationshipType":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"}},"required":["id","code","role","expiresAt"]},"AddCareTeamMemberNotificationResponseDto":{"type":"object","properties":{"emailStatus":{"type":"string"},"pushStatus":{"type":"string"},"errorMessage":{"type":"string"}},"required":["emailStatus","pushStatus"]},"AddCareTeamMemberResponseDto":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/AddCareTeamMemberUserResponseDto"},"invitation":{"$ref":"#/components/schemas/AddCareTeamMemberInvitationResponseDto"},"notification":{"$ref":"#/components/schemas/AddCareTeamMemberNotificationResponseDto"}},"required":["user","invitation"]},"NurseryUpdateBabyDto":{"type":"object","properties":{"babyId":{"type":"string","description":"BubuApp baby ID to update","example":"cmmmg0yd20000s601hdirnd1l"},"name":{"type":"string","description":"Baby full name","example":"Mateo Garcia"},"birthDate":{"format":"date-time","type":"string","description":"Baby's birth date","example":"2024-05-01"},"allergies":{"description":"Allergies. An empty list clears them.","example":["Peanuts"],"type":"array","items":{"type":"string"}}},"required":["babyId"]},"SendParentOnboardingNotificationDto":{"type":"object","properties":{"email":{"type":"string","description":"Parent email address"},"parentName":{"type":"string"},"babyName":{"type":"string","description":"Baby name for the email template"},"nurseryName":{"type":"string","description":"Nursery display name for the email template"},"invitationCode":{"type":"string","description":"Invitation code to include in the email"},"isNewUser":{"type":"boolean","default":true},"language":{"type":"string","description":"Preferred locale for nursery communications"},"nurseryLogoUrl":{"type":"string","description":"Public URL to the nursery's logo, shown in the welcome email"}},"required":["email","babyName","nurseryName","invitationCode"]},"SendParentOnboardingNotificationResponseDto":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]},"ResendCareTeamInvitationDto":{"type":"object","properties":{"babyId":{"type":"string","description":"Baby ID for the existing care-team invitation"},"email":{"type":"string","description":"Parent email address"},"phone":{"type":"string","description":"Parent phone number"},"parentName":{"type":"string"},"nurseryName":{"type":"string","description":"Nursery display name for the email template"},"language":{"type":"string","description":"Preferred locale for nursery communications"},"nurseryLogoUrl":{"type":"string","description":"Public URL to the nursery's logo, shown in the welcome email"}},"required":["babyId"]},"ResendCareTeamInvitationDetailsDto":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"}},"required":["id","code","expiresAt"]},"ResendCareTeamInvitationResponseDto":{"type":"object","properties":{"status":{"type":"string","description":"SENT, SKIPPED_ACCEPTED, or SKIPPED_NO_EMAIL"},"email":{"type":"string"},"invitation":{"$ref":"#/components/schemas/ResendCareTeamInvitationDetailsDto"}},"required":["status"]},"ClaimParentInvitationDto":{"type":"object","properties":{"babyId":{"type":"string","description":"Bubu baby ID being claimed"},"placeholderUserId":{"type":"string","description":"Placeholder Firebase UID created during nursery registration"},"relationshipType":{"type":"string","description":"Accepted parent relationship type","enum":["MOTHER","FATHER","STEP_MOTHER","STEP_FATHER","GRANDMOTHER","GRANDFATHER","AUNT","UNCLE","SIBLING","NANNY","BABYSITTER","DAYCARE_TEACHER","FAMILY_FRIEND","OTHER"]}},"required":["babyId"]},"ClaimParentInvitationResponseDto":{"type":"object","properties":{"userId":{"type":"string"},"babyId":{"type":"string"},"replacedPlaceholder":{"type":"boolean"},"replacedPlaceholderUserId":{"type":"string"}},"required":["userId","babyId","replacedPlaceholder"]},"NurseryParentInvitationCodeDto":{"type":"object","properties":{"code":{"type":"string","description":"Five-character nursery parent invitation code","example":"A1B2C"}},"required":["code"]},"InvitationNurseryDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"InvitationChildDto":{"type":"object","properties":{"id":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"fullName":{"type":"string"}}},"InvitationUserDto":{"type":"object","properties":{"userId":{"type":"string"},"invitedEmail":{"type":"string"}}},"NurseryParentInvitationPreviewResponseDto":{"type":"object","properties":{"valid":{"type":"boolean"},"invitationType":{"type":"string"},"code":{"type":"string"},"nursery":{"$ref":"#/components/schemas/InvitationNurseryDto"},"child":{"description":"Intentionally empty on unauthenticated preview to avoid exposing child PII.","allOf":[{"$ref":"#/components/schemas/InvitationChildDto"}]},"user":{"description":"Intentionally empty on unauthenticated preview to avoid exposing parent PII.","allOf":[{"$ref":"#/components/schemas/InvitationUserDto"}]},"bubuBabyId":{"type":"string"},"invitedEmail":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"},"status":{"type":"string"},"claimToken":{"type":"string"},"claimTokenExpiresAt":{"format":"date-time","type":"string"}},"required":["valid","invitationType","code","nursery","expiresAt","status","claimToken","claimTokenExpiresAt"]},"NurseryParentInvitationClaimRequestDto":{"type":"object","properties":{"code":{"type":"string","description":"Five-character nursery parent invitation code","example":"A1B2C"},"claimToken":{"type":"string","description":"Short-lived token returned by preview. The authenticated Firebase session must be newer than this token."}},"required":["code","claimToken"]},"OnboardingAgentVariablesDto":{"type":"object","properties":{"user_id":{"type":"string","description":"Bubu user id — for post-call session tracking, not an agent prompt var"},"companion_session_id":{"type":"string","description":"Opaque server-owned identity session used by secure post-call processing"},"user_name":{"type":"string"},"parent_role":{"type":"string","description":"Human-readable role label, e.g. \"Dad\""},"child_name":{"type":"string","description":"Child name, or \"your little one\" if not given"},"baby_name":{"type":"string"},"child_date_of_birth":{"type":"string","description":"YYYY-MM-DD, or empty"},"child_age":{"type":"string","description":"Whole months when born, else empty"},"child_age_label":{"type":"string"},"child_gender":{"type":"string"},"child_pronouns":{"type":"string"},"child_prematurity_status":{"type":"string"},"first_child_status":{"type":"string"},"known_parent_goal":{"type":"string"},"app_language":{"type":"string"},"onboarding_source":{"type":"string"}},"required":["user_id","user_name","parent_role","child_name","baby_name","child_date_of_birth","child_age","child_age_label","child_gender","child_pronouns","child_prematurity_status","first_child_status","known_parent_goal","app_language","onboarding_source"]},"NurseryParentInvitationClaimResponseDto":{"type":"object","properties":{"claimed":{"type":"boolean"},"userId":{"type":"string"},"bubuBabyId":{"type":"string"},"nurseryChildId":{"type":"string"},"nurseryId":{"type":"string"},"nextAction":{"type":"string"},"hasLinkedNursery":{"type":"boolean","description":"True when the claimed child is linked to a nursery (stable fact, not \"open now\"). False for a plain care-team / guardian invitation whose child is not at a nursery. Additive/optional so existing clients are unaffected."},"dynamicVariables":{"description":"ElevenLabs onboarding-agent dynamic variables (same shape as the onboarding voiceHandoff), built from the claimed child + parent so a nursery parent can be handed to the voice agent without re-onboarding. Only present when hasLinkedNursery is true. Additive/optional.","allOf":[{"$ref":"#/components/schemas/OnboardingAgentVariablesDto"}]}},"required":["claimed","userId","bubuBabyId","nurseryChildId","nurseryId","nextAction"]},"CreateSessionDto":{"type":"object","properties":{"babyId":{"type":"string","description":"Baby ID"},"type":{"type":"string","enum":["NIGHT","NAP"],"description":"Session type: NIGHT or NAP"},"actualStart":{"type":"string","description":"Session start time (ISO 8601)"},"actualEnd":{"type":"string","description":"Session end time (ISO 8601). Omit to start a timer — the session is created in-progress and actualEnd stays null until stopped."},"sleepLatencyMin":{"type":"number","description":"Sleep latency in minutes"},"source":{"type":"string","enum":["MANUAL","DEVICE","IMPORT"],"description":"Data source (default: MANUAL)"},"notes":{"type":"string","description":"Optional notes"}},"required":["babyId","type","actualStart"]},"NightWakingResponseDto":{"type":"object","properties":{"id":{"type":"string"},"sessionId":{"type":"string"},"babyId":{"type":"string"},"userId":{"type":"string"},"wakeStart":{"format":"date-time","type":"string"},"wakeEnd":{"format":"date-time","type":"string"},"durationMin":{"type":"number"},"feedGiven":{"type":"boolean"},"feedMl":{"type":"number"},"soothingMethod":{"type":"string"},"intensity":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"notes":{"type":"string"}},"required":["id","sessionId","babyId","userId","wakeStart","wakeEnd","durationMin","feedGiven"]},"SessionOriginTeacherDto":{"type":"object","properties":{"id":{"type":"string","description":"Nursery staff id."},"name":{"type":"string","nullable":true},"avatarUrl":{"type":"string","nullable":true,"description":"Short-lived signed URL, re-signed by the nursery on every read. Never cache it."}},"required":["id"]},"SessionOriginDto":{"type":"object","properties":{"type":{"type":"string","enum":["NURSERY"]},"nurseryName":{"type":"string","nullable":true,"description":"Null when the nursery could not be reached on this read."},"teacher":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/SessionOriginTeacherDto"}]}},"required":["type"]},"SessionPermissionsDto":{"type":"object","properties":{"canEdit":{"type":"boolean"},"canDelete":{"type":"boolean"}},"required":["canEdit","canDelete"]},"SessionResponseDto":{"type":"object","properties":{"id":{"type":"string"},"babyId":{"type":"string"},"userId":{"type":"string"},"type":{"type":"string","enum":["NIGHT","NAP"]},"actualStart":{"format":"date-time","type":"string"},"actualEnd":{"format":"date-time","type":"string","description":"Null while the session is in-progress (timer still running).","nullable":true},"totalSleepMin":{"type":"number","description":"Null while the session is in-progress.","nullable":true},"sleepLatencyMin":{"type":"number"},"source":{"type":"string","enum":["MANUAL","DEVICE","IMPORT"]},"notes":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"nightWakings":{"description":"Present only when the request included nightWakings.","type":"array","items":{"$ref":"#/components/schemas/NightWakingResponseDto"}},"nightWakingsCount":{"type":"number","description":"Derived from the nightWakings relation; computed on read."},"quality":{"type":"string","nullable":true,"description":"Nursery-reported nap quality (excellent | good | fair | poor). Null for parent-logged sessions."},"wakeMood":{"type":"string","nullable":true,"description":"Nursery-reported mood on waking. Null for parent-logged sessions."},"origin":{"nullable":true,"description":"Set when the session was logged outside the family (a nursery nap mirrored into the Sleep Hub). Null for parent-logged sessions.","allOf":[{"$ref":"#/components/schemas/SessionOriginDto"}]},"permissions":{"description":"What the caller may do with this session. Nursery-logged naps are read-only; the API enforces this with 403.","allOf":[{"$ref":"#/components/schemas/SessionPermissionsDto"}]}},"required":["id","babyId","userId","type","actualStart","source","createdAt","updatedAt","permissions"]},"SleepLogResponseDto":{"type":"object","properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/SessionResponseDto"}}},"required":["sessions"]},"UpdateSessionDto":{"type":"object","properties":{"type":{"type":"string","enum":["NIGHT","NAP"]},"actualStart":{"type":"string","description":"Session start time (ISO 8601)."},"actualEnd":{"type":"string","description":"Session end time (ISO 8601). Setting this on an in-progress session stops the timer. Sending explicit null on a completed session is rejected (cannot return to in-progress).","nullable":true},"sleepLatencyMin":{"type":"number","description":"Sleep latency in minutes. Explicit null intentionally clears the recorded value; omitting the field leaves it unchanged.","nullable":true},"source":{"type":"string","enum":["MANUAL","DEVICE","IMPORT"]},"notes":{"type":"string"}}},"CreateNightWakingDto":{"type":"object","properties":{"wakeStart":{"type":"string","description":"When the waking started (ISO 8601). Must fall within the parent session window."},"wakeEnd":{"type":"string","description":"When the waking ended (ISO 8601). Optional for the zero-form \"log a waking\" intent — omit and the server records a zero-duration waking at wakeStart."},"feedGiven":{"type":"boolean","description":"Whether a feed was given during this waking. Omit to leave unspecified; Prisma stores false by default (schema-locked)."},"feedMl":{"type":"number","description":"Feed volume in millilitres."},"soothingMethod":{"type":"string","description":"Soothing method used to settle the baby."},"intensity":{"type":"string","enum":["LOW","MEDIUM","HIGH"],"description":"Wake intensity."},"notes":{"type":"string","description":"Optional notes."}},"required":["wakeStart"]},"UpdateNightWakingDto":{"type":"object","properties":{"wakeStart":{"type":"string","description":"When the waking started (ISO 8601). Must fall within the parent session window."},"wakeEnd":{"type":"string","description":"When the waking ended (ISO 8601). Optional for the zero-form \"log a waking\" intent — omit and the server records a zero-duration waking at wakeStart."},"feedGiven":{"type":"boolean","description":"Whether a feed was given during this waking. Omit to leave unspecified; Prisma stores false by default (schema-locked)."},"feedMl":{"type":"number","description":"Feed volume in millilitres."},"soothingMethod":{"type":"string","description":"Soothing method used to settle the baby."},"intensity":{"type":"string","enum":["LOW","MEDIUM","HIGH"],"description":"Wake intensity."},"notes":{"type":"string","description":"Optional notes."}}},"ScheduleWindowDto":{"type":"object","properties":{"id":{"type":"string","description":"Window ID. Ignored on upsert (service regenerates all rows for the baby); returned on GET."},"type":{"type":"string","enum":["NIGHT","NAP"],"description":"NIGHT or NAP."},"start":{"type":"string","description":"Window start \"HH:MM\" (24-hour) in the baby's reference timezone. Reference TZ is the baby's OWNER (CareTeam role=OWNER) → UserProfile.timezone; co-parents in different TZs see the same value. NIGHT windows may have start > end to denote an overnight wrap (e.g. 19:00→06:30); NAP windows must have start < end."},"end":{"type":"string","description":"Window end \"HH:MM\" (24-hour) in the baby's reference timezone. See `start` for TZ resolution rules."},"label":{"type":"string","description":"Optional label, e.g. \"Nap 2\"."}},"required":["type","start","end"]},"SettingsResponseDto":{"type":"object","properties":{"babyId":{"type":"string"},"windows":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleWindowDto"}}},"required":["babyId","windows"]},"UpsertSettingsDto":{"type":"object","properties":{"windows":{"description":"Full replacement set of schedule windows for the baby. Existing windows are deleted and these are inserted in a single transaction.","type":"array","items":{"$ref":"#/components/schemas/ScheduleWindowDto"}}},"required":["windows"]},"InsightsTotalsDto":{"type":"object","properties":{"totalSleepMin":{"type":"number","description":"Net sleep minutes over the whole range, including today's completed sessions."},"nightSleepMin":{"type":"number","description":"Net NIGHT sleep minutes over the whole range."},"daySleepMin":{"type":"number","description":"Net NAP sleep minutes over the whole range."},"nightWakingsCount":{"type":"number","description":"Wakings on completed NIGHT sessions over the whole range, including today. Identical for every type filter."},"sessionCount":{"type":"number","description":"Completed sessions scoped to the type filter (all → every session, naps → NAP, night → NIGHT). In-progress sessions are never counted."}},"required":["totalSleepMin","nightSleepMin","daySleepMin","nightWakingsCount","sessionCount"]},"NapWindowDto":{"type":"object","properties":{"startLocal":{"type":"string","description":"Local HH:mm the nap started, in the reference timezone."},"endLocal":{"type":"string","nullable":true,"description":"Local HH:mm the nap ended; null while still in progress."}},"required":["startLocal","endLocal"]},"DailyInsightDto":{"type":"object","properties":{"date":{"type":"string"},"totalSleepMin":{"type":"number","description":"Net sleep minutes attributed to this local date."},"nightSleepMin":{"type":"number"},"daySleepMin":{"type":"number"},"nightWakingsCount":{"type":"number"},"napCount":{"type":"number","description":"Completed NAP sessions starting on this date."},"isPartial":{"type":"boolean","description":"True for the current local date (day not finished) and for dates with an in-progress session. Partial days appear in totals but never in average denominators."},"firstStretchMin":{"type":"number","nullable":true,"description":"Minutes from the night's sleep start to the first RECORDED waking. A split night with no recorded waking uses the first segment's length. Null = unknown (a night with no recorded waking is NOT \"slept through\"), and always null for the current local date."},"bedtimeLocal":{"type":"string","nullable":true,"description":"Earliest NIGHT start on this date as local HH:mm. Null with no night session or under timezone fallback."},"finalWakeLocal":{"type":"string","nullable":true,"description":"Latest NIGHT end on this date as local HH:mm. Null with no completed night session or under timezone fallback."},"napWindows":{"description":"Nap start/end clock times on this date, including in-progress naps (null end). Empty under timezone fallback.","type":"array","items":{"$ref":"#/components/schemas/NapWindowDto"}},"recordedAwakeOvernightMin":{"type":"number","description":"Merged recorded waking minutes inside this date's NIGHT sessions — the amount subtracted from gross to reach nightSleepMin."},"wakingsWithDurationCount":{"type":"number","description":"Subset of this date's nightWakingsCount with a recorded positive duration. When lower than nightWakingsCount, recordedAwakeOvernightMin undercounts the real awake time — the per-day analogue of coverage.wakingsWithDurationCount."}},"required":["date","totalSleepMin","nightSleepMin","daySleepMin","nightWakingsCount","napCount","isPartial","firstStretchMin","bedtimeLocal","finalWakeLocal","napWindows","recordedAwakeOvernightMin","wakingsWithDurationCount"]},"BestDayDto":{"type":"object","properties":{"date":{"type":"string","description":"YYYY-MM-DD of the highest-minutes day in the filtered range."},"minutes":{"type":"number","description":"Net minutes of sleep on the best day (scoped to the current filter)."}},"required":["date","minutes"]},"InsightsCoverageDto":{"type":"object","properties":{"periodDays":{"type":"number","description":"Days in the requested range, inclusive."},"trackedDays":{"type":"number","description":"Past local dates (today excluded) with at least one completed session. Denominator for per-day averages."},"completedNights":{"type":"number","description":"Tracked days with at least one completed NIGHT session. Denominator for per-night averages."},"incompleteSessionCount":{"type":"number","description":"In-progress sessions whose start date falls in the range."},"wakingCount":{"type":"number","description":"Wakings on past completed nights — the population behind averageNightWakings and averageRecordedAwakeOvernightMin. Unlike totals.nightWakingsCount, excludes today."},"wakingsWithDurationCount":{"type":"number","description":"Subset of wakingCount with a recorded positive duration. When lower than wakingCount, averageRecordedAwakeOvernightMin undercounts real awake time."}},"required":["periodDays","trackedDays","completedNights","incompleteSessionCount","wakingCount","wakingsWithDurationCount"]},"SignalWindowDto":{"type":"object","properties":{"from":{"type":"string","description":"Inclusive local YYYY-MM-DD window start."},"to":{"type":"string","description":"Inclusive local YYYY-MM-DD window end."},"nights":{"type":"number","description":"Completed nights found inside the window."}},"required":["from","to","nights"]},"DerivedSignalDto":{"type":"object","properties":{"key":{"type":"string","enum":["first_stretch_shorter","night_wakings_increased","total_sleep_decreased"],"description":"Stable metric identity. Unknown keys must be ignored by clients."},"recentValue":{"type":"number","description":"Recent-window average, in the metric's unit."},"baselineValue":{"type":"number","description":"Baseline-window average, in the metric's unit."},"delta":{"type":"number","description":"Signed recent minus baseline. Negative = the metric fell."},"agreeingNights":{"type":"number","description":"Recent nights individually worse than the baseline average, out of comparedNights. Signals only fire on a strict majority."},"comparedNights":{"type":"number"},"window":{"type":"string","description":"Human-readable window label, e.g. \"last_7_nights_vs_prior_21\"."}},"required":["key","recentValue","baselineValue","delta","agreeingNights","comparedNights","window"]},"DerivedSignalsBlockDto":{"type":"object","properties":{"asOf":{"type":"string","description":"The anchor date: comparisons describe the situation as of this local date (= the requested `to`), NOT necessarily today."},"recentWindow":{"$ref":"#/components/schemas/SignalWindowDto"},"baselineWindow":{"$ref":"#/components/schemas/SignalWindowDto"},"patternEligible":{"type":"boolean","description":"False when either window lacks enough completed nights for any pattern claim; signals is then always empty."},"signals":{"description":"Adverse-direction signals that cleared the deterministic thresholds, strongest first. Empty is a valid, meaningful answer: no deterioration detected.","type":"array","items":{"$ref":"#/components/schemas/DerivedSignalDto"}}},"required":["asOf","recentWindow","baselineWindow","patternEligible","signals"]},"InsightsSummaryDto":{"type":"object","properties":{"averageTotalSleepMin":{"type":"number","nullable":true,"description":"Net minutes per tracked day."},"averageNightSleepMin":{"type":"number","nullable":true,"description":"Net NIGHT minutes per completed night."},"averageDaySleepMin":{"type":"number","nullable":true,"description":"Net NAP minutes per tracked day."},"averageNapCount":{"type":"number","nullable":true,"description":"Naps per tracked day, one decimal."},"averageNightWakings":{"type":"number","nullable":true,"description":"Wakings per completed night, one decimal."},"averageRecordedAwakeOvernightMin":{"type":"number","nullable":true,"description":"Recorded awake minutes per completed night. Only wakings with a positive duration contribute — see coverage.wakingsWithDurationCount."},"typicalBedtime":{"type":"string","nullable":true,"description":"Circular mean bedtime \"HH:mm\" in the reference timezone. Null under timezone fallback or with no completed nights."},"typicalWakeTime":{"type":"string","nullable":true,"description":"Circular mean morning wake time \"HH:mm\". Null under timezone fallback or with no completed nights."},"bedtimeVariationMin":{"type":"number","nullable":true,"description":"Circular standard deviation of bedtime in minutes. Null under timezone fallback or with fewer than two completed nights."},"wakeTimeVariationMin":{"type":"number","nullable":true,"description":"Circular standard deviation of morning wake time in minutes. Same null rules as bedtimeVariationMin."},"averageFirstStretchMin":{"type":"number","nullable":true,"description":"Mean first stretch over past completed nights whose first stretch is known (see daily.firstStretchMin). Null when no night qualifies."},"firstStretchNights":{"type":"number","description":"Denominator of averageFirstStretchMin — nights with a known first stretch."},"averageSleepLatencyNightMin":{"type":"number","nullable":true,"description":"Mean of observed (non-null) NIGHT sleepLatencyMin over sessions starting in the range, today and in-progress sessions included. Unrecorded latencies never count as zero."},"sleepLatencyNightCount":{"type":"number","description":"Observed NIGHT latency count behind the average."},"averageSleepLatencyNapMin":{"type":"number","nullable":true,"description":"Mean of observed (non-null) NAP sleepLatencyMin over sessions starting in the range. Same rules as the NIGHT average."},"sleepLatencyNapCount":{"type":"number","description":"Observed NAP latency count behind the average."},"derivedSignals":{"description":"Recent-vs-baseline comparison anchored to the requested range end (asOf = `to`), computed with the Sleep Priority Card's deterministic rules and windows — never from a cache.","allOf":[{"$ref":"#/components/schemas/DerivedSignalsBlockDto"}]}},"required":["averageTotalSleepMin","averageNightSleepMin","averageDaySleepMin","averageNapCount","averageNightWakings","averageRecordedAwakeOvernightMin","typicalBedtime","typicalWakeTime","bedtimeVariationMin","wakeTimeVariationMin","averageFirstStretchMin","firstStretchNights","averageSleepLatencyNightMin","sleepLatencyNightCount","averageSleepLatencyNapMin","sleepLatencyNapCount","derivedSignals"]},"RecordedAwakeWindowDto":{"type":"object","properties":{"actualStart":{"type":"string","description":"ISO instant the confirmed awake interval started."},"actualEnd":{"type":"string","description":"ISO instant the confirmed awake interval ended."}},"required":["actualStart","actualEnd"]},"SleepWindowDto":{"type":"object","properties":{"type":{"type":"string","enum":["NIGHT","NAP"]},"attributedDate":{"type":"string","description":"Local YYYY-MM-DD the session is attributed to (start-day attribution in the reference timezone). May lie before `from` for a night that bleeds into the range."},"actualStart":{"type":"string","description":"ISO instant the session started."},"actualEnd":{"type":"string","nullable":true,"description":"ISO instant the session ended; null while in progress. An open window has no server-side boundary: it intersects the range through the current local date and the client chooses its temporary display end (typically \"now\")."},"sleepLatencyMin":{"type":"number","nullable":true,"description":"Recorded sleep latency of this session; null = not recorded."},"recordedAwakeWindows":{"description":"Confirmed positive-duration awake intervals inside this window, clipped to the session bounds and merged where they overlap. Zero-duration wakings never appear. Always empty for NAP sessions (NAP-attached wakings are invalid data).","type":"array","items":{"$ref":"#/components/schemas/RecordedAwakeWindowDto"}}},"required":["type","attributedDate","actualStart","actualEnd","sleepLatencyMin","recordedAwakeWindows"]},"PersonalBaselineEntryDto":{"type":"object","properties":{"metric":{"type":"string","enum":["total_sleep_min_per_day","night_sleep_min_per_night","day_sleep_min_per_day","recorded_awake_min_per_night","night_wakings_per_night","first_stretch_min","bedtime_variation_min","sleep_latency_night_min","sleep_latency_nap_min"],"description":"Stable metric identity. Unknown keys must be ignored."},"center":{"type":"number","nullable":true,"description":"The child's typical value: the median of the window samples (v1). Null unless state is ELIGIBLE."},"low":{"type":"number","nullable":true,"description":"Lower edge of the typical band: 25th percentile of the window samples (v1), linear interpolation. Null unless ELIGIBLE."},"high":{"type":"number","nullable":true,"description":"Upper edge of the typical band: 75th percentile (v1). Null unless ELIGIBLE."},"unit":{"type":"string","enum":["min","count"]},"eligibleCount":{"type":"number","description":"Samples behind the baseline (tracked days, completed nights, or observed latencies depending on the metric). Present in every state."},"windowFrom":{"type":"string","description":"Inclusive local YYYY-MM-DD start of the baseline window."},"windowTo":{"type":"string","description":"Inclusive local YYYY-MM-DD end of the baseline window (= the requested `to`)."},"algorithmVersion":{"type":"number","description":"Version of the baseline algorithm that produced this entry. Bands from different versions must never be compared."},"state":{"type":"string","enum":["ELIGIBLE","INSUFFICIENT_DATA","TIMEZONE_FALLBACK"],"description":"Deterministic eligibility: ELIGIBLE when the sample minimum is met, INSUFFICIENT_DATA below it, TIMEZONE_FALLBACK for clock-derived metrics grouped in UTC. Ineligible entries keep eligibleCount and the window so RN can explain what is missing."}},"required":["metric","center","low","high","unit","eligibleCount","windowFrom","windowTo","algorithmVersion","state"]},"AgeReferenceBandDto":{"type":"object","properties":{"fromMonths":{"type":"number","description":"Inclusive lower age of the band in whole months."},"toMonths":{"type":"number","description":"Exclusive upper age of the band in whole months."},"label":{"type":"string","description":"Product label, e.g. \"7 to 11 months\". English only; the client localises."}},"required":["fromMonths","toMonths","label"]},"AgeReferenceEntryDto":{"type":"object","properties":{"metric":{"type":"string","enum":["total_sleep_min_per_day","night_sleep_min_per_night","day_sleep_min_per_day","nap_count_per_day","bedtime_minutes_of_day"],"description":"Stable metric identity. The first three match personalBaselines keys so one chart can draw both bands. Unknown keys must be ignored."},"unit":{"type":"string","enum":["min","count","clock"],"description":"'clock' = minutes after local midnight (1110 = 18:30)."},"low":{"type":"number","nullable":true,"description":"Lower edge of the expected band for this age, inclusive. Null when state is NO_GUIDANCE."},"high":{"type":"number","nullable":true,"description":"Upper edge of the expected band for this age, inclusive. Null when state is NO_GUIDANCE."},"source":{"type":"string","nullable":true,"description":"Guidance behind the band: 'AASM_2016', 'NSF_2015' or 'BUBU_TYPICAL_SCHEDULE_V1'. Null when NO_GUIDANCE."},"daysInRange":{"type":"number","description":"Days (or completed nights) of the requested range whose value fell inside the band."},"daysCompared":{"type":"number","description":"Denominator: tracked past days for per-day metrics, completed past nights for night sleep and bedtime. Same populations as the summary averages; today never counts."},"state":{"type":"string","enum":["ELIGIBLE","NO_GUIDANCE","NO_DATA","TIMEZONE_FALLBACK"],"description":"ELIGIBLE when a band exists and at least one day was compared; NO_GUIDANCE when the table has no band for this metric at this age (e.g. naps under 4 months); NO_DATA when the range has no eligible day; TIMEZONE_FALLBACK for bedtime when days were grouped in UTC and a band exists (NO_GUIDANCE wins otherwise)."}},"required":["metric","unit","low","high","source","daysInRange","daysCompared","state"]},"AgeReferenceDto":{"type":"object","properties":{"version":{"type":"number","description":"Version of the reference table. Bands from different versions must never be compared."},"ageMonths":{"type":"number","nullable":true,"description":"The child's whole months at `to`. Null without a birth date."},"band":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/AgeReferenceBandDto"}]},"state":{"type":"string","enum":["ELIGIBLE","NO_BIRTH_DATE","OUT_OF_RANGE"],"description":"NO_BIRTH_DATE when the baby has no (or a future) birth date; OUT_OF_RANGE from 84 months. Entries are empty in both."},"entries":{"description":"One entry per metric; empty unless state is ELIGIBLE.","type":"array","items":{"$ref":"#/components/schemas/AgeReferenceEntryDto"}}},"required":["version","ageMonths","band","state","entries"]},"InsightsResponseDto":{"type":"object","properties":{"babyId":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"type":{"type":"string","enum":["all","naps","night"]},"timezone":{"type":"string","description":"Reference IANA timezone used for day grouping and clock metrics: the baby OWNER's profile timezone, else their last-active device timezone, else \"UTC\". Never the caller's timezone, so all caregivers see identical statistics."},"timezoneFallback":{"type":"boolean","description":"True when no owner timezone could be resolved and days were grouped in UTC. Clock metrics (typical times and variations) are null in that case."},"totals":{"$ref":"#/components/schemas/InsightsTotalsDto"},"daily":{"description":"One row per local date with any session, plus always a row for the current local date when it is inside the range. Rows are identical for every type filter.","type":"array","items":{"$ref":"#/components/schemas/DailyInsightDto"}},"bestDay":{"deprecated":true,"description":"Deprecated — prefer summary averages. Highest net-minutes day scoped to the type filter (all → totalSleepMin, naps → daySleepMin, night → nightSleepMin). Null when the range has no positive day.","nullable":true,"allOf":[{"$ref":"#/components/schemas/BestDayDto"}]},"coverage":{"$ref":"#/components/schemas/InsightsCoverageDto"},"summary":{"$ref":"#/components/schemas/InsightsSummaryDto"},"sleepWindows":{"description":"Every session window intersecting the requested civil range in the reference timezone, ordered by actualStart, identical for every type filter. Includes in-progress windows (null end) and a night starting before `from` that continues into the range.","type":"array","items":{"$ref":"#/components/schemas/SleepWindowDto"}},"personalBaselines":{"description":"Always-present personal baseline bands, one entry per target metric, computed over the 28 local dates ending at `to` (the Priority Card's recent+baseline lookback) — deliberately NOT the displayed range, so the band is a norm to compare the range against. v1 algorithm: median center, p25..p75 band. Product owns the final algorithm; compare only entries with equal algorithmVersion.","type":"array","items":{"$ref":"#/components/schemas/PersonalBaselineEntryDto"}},"ageReference":{"description":"Always-present age reference: the expected band per metric for the child's age at `to` (product owned table; totals follow AASM 2016) and how many days of the displayed range fell inside it. Deterministic, no model. Read next to personalBaselines: the personal band is the child's own norm, the age band is the guidance.","allOf":[{"$ref":"#/components/schemas/AgeReferenceDto"}]}},"required":["babyId","from","to","type","timezone","timezoneFallback","totals","daily","coverage","summary","sleepWindows","personalBaselines","ageReference"]},"PriorityCardMetricDto":{"type":"object","properties":{"value":{"type":"string","example":"1h 50m"},"label":{"type":"string","example":"first stretch"},"comparison":{"type":"string","nullable":true,"example":"2h 05m below usual","description":"Comparison against the child’s own baseline, never a population."}},"required":["value","label"]},"PriorityCardCompactDto":{"type":"object","properties":{"label":{"type":"string","nullable":true,"example":"What changed","description":"Optional quiet micro-label. Null is a valid, deliberate value — the generated layer may drop a label that would over-section the card."},"text":{"type":"string","example":"First stretch shortened"},"metricValue":{"type":"string","nullable":true,"example":"1h 50m"},"metricLabel":{"type":"string","nullable":true,"example":"first stretch"}},"required":["label","text"]},"PriorityCardCtaDto":{"type":"object","properties":{"label":{"type":"string","example":"Talk to Bubu"},"actionId":{"type":"string","description":"One of the backend’s allowed action ids. Never generated, never invented.","example":"open_companion"},"targetItemId":{"type":"string","nullable":true}},"required":["label","actionId"]},"PriorityCardExpandedDto":{"type":"object","properties":{"headline":{"type":"string"},"explanation":{"type":"string","description":"One or two sentences explaining the compact claim."},"scienceOrImpact":{"type":"string","nullable":true,"description":"Approved developmental or scientific relevance. Null until reviewed wording exists; never generated freely."},"support":{"type":"string","nullable":true},"sourceLine":{"type":"string","description":"Exact source and window for this item.","example":"From 6 logged nights, 27 July to 2 August"},"cta":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/PriorityCardCtaDto"}]}},"required":["headline","explanation","sourceLine"]},"PriorityCardItemDto":{"type":"object","properties":{"itemId":{"type":"string","description":"Stable id joining the compact item to its expanded detail.","example":"situation_first_stretch"},"role":{"type":"string","description":"situation (why this card), next_action (what to do), parent_support (how, practically), plus the dimension roles for a stable card.","example":"situation"},"rank":{"type":"number","description":"Display order, starting at 1."},"compact":{"$ref":"#/components/schemas/PriorityCardCompactDto"},"expanded":{"$ref":"#/components/schemas/PriorityCardExpandedDto"},"evidenceRefs":{"description":"Facts this item rests on. Empty for supportive items.","type":"array","items":{"type":"string"}}},"required":["itemId","role","rank","compact","expanded","evidenceRefs"]},"PriorityCardMetaDto":{"type":"object","properties":{"dataState":{"type":"string","example":"sufficient"},"baselineWindow":{"type":"string","nullable":true,"description":"Baseline window actually used, when a comparison was made."},"missingDataKeys":{"description":"Inputs that would unlock a better card if supplied.","type":"array","items":{"type":"string"}},"timezoneFallback":{"type":"boolean","description":"True when the child’s owner has no resolvable timezone and UTC was assumed. Clock-based claims are suppressed."}},"required":["dataState","missingDataKeys","timezoneFallback"]},"SleepPriorityCardResponseDto":{"type":"object","properties":{"babyId":{"type":"string"},"cardState":{"type":"string","description":"Backend-selected state. The content layer may never change it.","example":"significant_change"},"priorityKey":{"type":"string","example":"first_stretch_shorter"},"headline":{"type":"string","example":"Nights are breaking earlier"},"companionTeaser":{"type":"string","description":"One line that opens the swipe experience."},"primaryMetric":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/PriorityCardMetricDto"}]},"sourceLine":{"type":"string","example":"From 6 logged nights in the last 7 days"},"items":{"description":"Two to four items.","type":"array","items":{"$ref":"#/components/schemas/PriorityCardItemDto"}},"primaryCta":{"$ref":"#/components/schemas/PriorityCardCtaDto"},"meta":{"$ref":"#/components/schemas/PriorityCardMetaDto"}},"required":["babyId","cardState","priorityKey","headline","companionTeaser","sourceLine","items","primaryCta","meta"]},"SleepSignalDto":{"type":"object","properties":{"key":{"type":"string","example":"night_wakings_increased","enum":["first_stretch_shorter","night_wakings_increased","total_sleep_decreased"],"description":"Which adverse change fired. Stable machine key."},"recentValue":{"type":"number","example":3.2,"description":"Recent-window average, in the metric’s own unit (count for wakings, minutes otherwise)."},"baselineValue":{"type":"number","example":1.4,"description":"Baseline-window average, same unit."},"delta":{"type":"number","example":1.8,"description":"recentValue minus baselineValue. Negative means the metric fell."},"agreeingNights":{"type":"number","example":4,"description":"Recent nights individually worse than baseline."},"comparedNights":{"type":"number","example":5,"description":"Recent nights with a usable value."},"window":{"type":"string","example":"last_5_nights_vs_prior_14","description":"The comparison windows the signal was derived from."}},"required":["key","recentValue","baselineValue","delta","agreeingNights","comparedNights","window"]},"SleepSignalResponseDto":{"type":"object","properties":{"babyId":{"type":"string","example":"cmk6244ug000gmojkg4ht7cgh"},"signal":{"nullable":true,"description":"The strongest current signal, or null when nothing is elevated, data is stale, or there is not enough history to compare.","allOf":[{"$ref":"#/components/schemas/SleepSignalDto"}]},"computedAt":{"type":"string","example":"2026-08-30T18:00:00.000Z"}},"required":["babyId","computedAt"]},"SleepGoalResponseDto":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string","description":"Localized display title."},"description":{"type":"string","description":"Localized long-form description."},"language":{"type":"string","description":"BCP-47 locale code, e.g. \"en-GB\"."},"isActive":{"type":"boolean"}},"required":["id","slug","title","language","isActive"]},"BabySleepGoalsResponseDto":{"type":"object","properties":{"babyId":{"type":"string"},"goals":{"type":"array","items":{"$ref":"#/components/schemas/SleepGoalResponseDto"}}},"required":["babyId","goals"]},"UpdateBabySleepGoalsDto":{"type":"object","properties":{"goalIds":{"description":"Goal IDs to set (replace-semantics)","type":"array","items":{"type":"string"}}},"required":["goalIds"]},"CreateGuideSectionDto":{"type":"object","properties":{"title":{"type":"string"},"body":{"type":"string"},"orderIndex":{"type":"number"}},"required":["title","body"]},"CreateGuideDto":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"thumbnailUrl":{"type":"string"},"orderIndex":{"type":"number","default":0},"language":{"type":"string","default":"en-GB","example":"en-GB"},"sections":{"type":"array","items":{"$ref":"#/components/schemas/CreateGuideSectionDto"}}},"required":["slug","title","sections"]},"GuideSectionResponseDto":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"orderIndex":{"type":"number"}},"required":["id","title","body","orderIndex"]},"GuideDetailResponseDto":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"thumbnailUrl":{"type":"string"},"orderIndex":{"type":"number"},"language":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"sections":{"type":"array","items":{"$ref":"#/components/schemas/GuideSectionResponseDto"}}},"required":["id","slug","title","orderIndex","language","isActive","createdAt","updatedAt","sections"]},"GuideListItemDto":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"thumbnailUrl":{"type":"string"},"orderIndex":{"type":"number"},"language":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","slug","title","orderIndex","language","isActive","createdAt","updatedAt"]},"PaginatedGuidesDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GuideListItemDto"}},"skip":{"type":"number"},"take":{"type":"number"},"total":{"type":"number"}},"required":["data","skip","take","total"]},"UpdateGuideSectionDto":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"orderIndex":{"type":"number"}},"required":["title","body"]},"UpdateGuideDto":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"thumbnailUrl":{"type":"string"},"orderIndex":{"type":"number"},"language":{"type":"string","example":"en-GB"},"isActive":{"type":"boolean"},"sections":{"type":"array","items":{"$ref":"#/components/schemas/UpdateGuideSectionDto"}}}},"OnboardingOptionDto":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"string"},"label":{"type":"string"},"orderIndex":{"type":"number"}},"required":["id","value","label","orderIndex"]},"OnboardingQuestionDto":{"type":"object","properties":{"id":{"type":"string"},"fieldId":{"type":"string","nullable":true,"description":"Stable semantic key, e.g. \"main_concerns\"."},"type":{"type":"string"},"question":{"type":"string"},"isRequired":{"type":"boolean"},"orderIndex":{"type":"number"},"renderConfig":{"type":"object","nullable":true},"options":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingOptionDto"}}},"required":["id","fieldId","type","question","isRequired","orderIndex","renderConfig","options"]},"OnboardingQuestionnaireDto":{"type":"object","properties":{"id":{"type":"string","description":"Version-pinned questionnaire id."},"version":{"type":"number"},"title":{"type":"string"},"acknowledgement":{"type":"string","nullable":true,"description":"Acknowledgement copy shown at completion; versioned with the question set."},"questions":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingQuestionDto"}}},"required":["id","version","title","acknowledgement","questions"]},"OnboardingAnswerStateDto":{"type":"object","properties":{"questionId":{"type":"string"},"value":{"type":"object","nullable":true},"skipped":{"type":"boolean"},"source":{"type":"string","enum":["voice","text",null],"nullable":true},"rawText":{"type":"string","nullable":true},"answeredAt":{"type":"string"}},"required":["questionId","value","skipped","source","rawText","answeredAt"]},"OnboardingStateResponseDto":{"type":"object","properties":{"questionnaire":{"$ref":"#/components/schemas/OnboardingQuestionnaireDto"},"answers":{"description":"The caller's saved answers for this questionnaire version — the resume state.","type":"array","items":{"$ref":"#/components/schemas/OnboardingAnswerStateDto"}},"completed":{"type":"boolean"},"completedAt":{"type":"string","nullable":true}},"required":["questionnaire","answers","completed","completedAt"]},"OnboardingAnswerInputDto":{"type":"object","properties":{"questionId":{"type":"string","description":"Stable question id from the fetched set."},"value":{"type":"object","description":"The answer value, shaped by the question type (option value, number, text…). Omit when skipped."},"skipped":{"type":"boolean","description":"True to record a deliberate skip. A skip is stored explicitly — never as an invented default. Exactly one of value/skipped must be present."},"source":{"type":"string","enum":["voice","text"]},"locale":{"type":"string","description":"BCP-47 locale the answer was given in."},"conversationRef":{"type":"string","description":"Companion session or conversation id, for voice provenance."},"rawText":{"type":"string","description":"The parent's exact wording, preserved verbatim when `value` holds a normalized form."}},"required":["questionId","source"]},"SaveOnboardingAnswersDto":{"type":"object","properties":{"questionnaireId":{"type":"string","description":"The questionnaire version the answers were given against (the id returned by GET). Answers are version-pinned; a stale id is rejected, never remapped."},"answers":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingAnswerInputDto"}}},"required":["questionnaireId","answers"]},"SaveOnboardingAnswersResponseDto":{"type":"object","properties":{"saved":{"type":"number"}},"required":["saved"]},"CompleteOnboardingDto":{"type":"object","properties":{"questionnaireId":{"type":"string","description":"The questionnaire version being completed."}},"required":["questionnaireId"]},"CompleteOnboardingResponseDto":{"type":"object","properties":{"completed":{"type":"boolean"},"completedAt":{"type":"string","description":"Stable across retries: completing an already-completed onboarding returns the original timestamp."}},"required":["completed","completedAt"]},"InternalOnboardingAnswerDto":{"type":"object","properties":{"userId":{"type":"string"},"babyId":{"type":"string"},"fieldId":{"type":"string","description":"Semantic question key, e.g. \"main_concerns\"."},"rawText":{"type":"string","description":"The parent's exact wording, verbatim."},"source":{"type":"string","enum":["voice","text"]},"locale":{"type":"string"},"conversationRef":{"type":"string","description":"Companion session or conversation id."},"questionnaireId":{"type":"string","description":"Version-pinned questionnaire id, bound into the Companion session when the parent was asked. Required: there is no active-version fallback, so a rollout mid-call can never remap the answer."}},"required":["userId","babyId","fieldId","rawText","source","questionnaireId"]},"InternalOnboardingAnswerResponseDto":{"type":"object","properties":{"saved":{"type":"boolean"},"questionnaireId":{"type":"string"},"questionId":{"type":"string"}},"required":["saved","questionnaireId","questionId"]},"MirrorNurseryNapDto":{"type":"object","properties":{}},"RemoveNurseryNapMirrorsDto":{"type":"object","properties":{}},"CreateMemoryDto":{"type":"object","properties":{"type":{"type":"string","enum":["JOURNAL","FIRST_REACTION","QUOTE","FAVORITE","PHASE","PHOTO","VIDEO","VOICE","ARTWORK","NURSERY","TRIP","CELEBRATION","BRAVE","FUNNY"],"description":"What kind of memory this is"},"title":{"type":"string","description":"Short title"},"rawInput":{"type":"string","description":"The parent’s own words — one line is enough"},"memoryDate":{"type":"string","description":"When it happened (ISO 8601)"},"place":{"type":"string","description":"Where it happened"},"tags":{"description":"Free-form tags","type":"array","items":{"type":"string"}},"assetIds":{"description":"MemoryAsset ids (from POST /:babyId/assets) to attach to this memory","type":"array","items":{"type":"string"}},"personIds":{"description":"Person ids (from the people room) present in this memory","type":"array","items":{"type":"string"}},"attributes":{"type":"object","description":"Type-specific extras (e.g. phase endDate, favorite category)"},"status":{"type":"string","enum":["DRAFT","VISIBLE"],"description":"Defaults to VISIBLE. Use DRAFT for parent-reviewed captions."}},"required":["type","memoryDate"]},"MemoryAssetResponseDto":{"type":"object","properties":{"id":{"type":"string"},"assetType":{"type":"string","enum":["PHOTO","VIDEO","VOICE","ARTWORK"]},"fileId":{"type":"string"},"url":{"type":"string","description":"Signed download URL"},"thumbnailUrl":{"type":"string","description":"Signed thumbnail or video poster URL"},"durationSec":{"type":"number","description":"Recorded media duration in seconds"},"status":{"type":"string","enum":["PENDING_UPLOAD","PROCESSING","READY","FAILED"],"description":"Multipart uploads are READY at once. Direct uploads go PENDING_UPLOAD → PROCESSING → READY (or FAILED); url and thumbnailUrl are only present when READY and only READY assets can be attached"},"processingError":{"type":"string","description":"Stable code, set when status is FAILED: VIDEO_TOO_LONG, VIDEO_TOO_LARGE (over 4K), VIDEO_UNREADABLE, VIDEO_NO_VIDEO_STREAM, VIDEO_SOURCE_MISSING, VIDEO_SOURCE_CHANGED, UPLOAD_TOO_LARGE, TRANSCODE_FAILED (retries exhausted), ASSET_REMOVED","example":"VIDEO_TOO_LONG"},"memoryId":{"type":"string"},"milestoneId":{"type":"string"},"orderIndex":{"type":"number"},"createdAt":{"format":"date-time","type":"string"}},"required":["id","assetType","fileId","status","orderIndex","createdAt"]},"PersonRefDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"relationship":{"type":"string"}},"required":["id","name"]},"MemoryResponseDto":{"type":"object","properties":{"id":{"type":"string"},"babyId":{"type":"string"},"source":{"type":"string","enum":["PARENT_MANUAL","COMPANION","NURSERY","CAMERA_ROLL","OTHER_HUB"]},"type":{"type":"string","enum":["JOURNAL","FIRST_REACTION","QUOTE","FAVORITE","PHASE","PHOTO","VIDEO","VOICE","ARTWORK","NURSERY","TRIP","CELEBRATION","BRAVE","FUNNY"]},"title":{"type":"string"},"rawInput":{"type":"string"},"displayText":{"type":"string"},"aiRewritten":{"type":"boolean"},"memoryDate":{"format":"date-time","type":"string"},"childAgeMonths":{"type":"number"},"place":{"type":"string"},"status":{"type":"string","enum":["DRAFT","VISIBLE","HIDDEN"]},"consentStatus":{"type":"string","enum":["NOT_REQUIRED","PENDING","GRANTED"]},"tags":{"type":"array","items":{"type":"string"}},"attributes":{"type":"object"},"createdAt":{"format":"date-time","type":"string"},"assets":{"type":"array","items":{"$ref":"#/components/schemas/MemoryAssetResponseDto"}},"people":{"type":"array","items":{"$ref":"#/components/schemas/PersonRefDto"}}},"required":["id","babyId","source","type","aiRewritten","memoryDate","status","consentStatus","tags","createdAt","assets","people"]},"CreateDirectUploadDto":{"type":"object","properties":{"assetType":{"type":"string","enum":["PHOTO","VIDEO","VOICE","ARTWORK"],"example":"VIDEO","description":"Only VIDEO is accepted for direct upload today"},"contentType":{"type":"string","enum":["video/mp4","video/quicktime","video/webm"],"example":"video/mp4","description":"Exact Content-Type the client will send on the PUT; it is bound into the signed URL"},"sizeBytes":{"type":"number","example":48211123,"description":"Byte size of the file that will be uploaded (max 500MB)"},"fileName":{"type":"string","example":"IMG_1234.MOV"}},"required":["assetType","contentType","sizeBytes"]},"DirectUploadInstructionsDto":{"type":"object","properties":{"url":{"type":"string","description":"Signed Google Cloud Storage URL to PUT the raw file to"},"method":{"type":"string","example":"PUT"},"headers":{"type":"object","description":"Send these headers exactly as given on the PUT; they are part of the signature","example":{"Content-Type":"video/mp4","x-goog-content-length-range":"0,524288000"}},"expiresAt":{"format":"date-time","type":"string","description":"The URL and the asset stop being usable after this time"}},"required":["url","method","headers","expiresAt"]},"DirectUploadResponseDto":{"type":"object","properties":{"asset":{"description":"The asset in PENDING_UPLOAD; call complete after the PUT succeeds","allOf":[{"$ref":"#/components/schemas/MemoryAssetResponseDto"}]},"upload":{"$ref":"#/components/schemas/DirectUploadInstructionsDto"},"maxBytes":{"type":"number","example":524288000},"maxDurationSec":{"type":"number","example":300}},"required":["asset","upload","maxBytes","maxDurationSec"]},"FavoriteBooksResponseDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MemoryResponseDto"}},"total":{"type":"number"},"skip":{"type":"number"},"take":{"type":"number"}},"required":["items","total","skip","take"]},"CreateFavoriteBookDto":{"type":"object","properties":{"title":{"type":"string","description":"Typed title. Optional when a cover asset can be identified."},"note":{"type":"string","description":"Why the child loves this book"},"assetId":{"type":"string","description":"Unattached parent cover photo asset"},"memoryDate":{"type":"string","description":"When it became a favorite. Defaults to now."}}},"UpdateFavoriteBookDto":{"type":"object","properties":{"title":{"type":"string"},"note":{"type":"string","description":"Why the child loves this book"}}},"FirstResponseDto":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","description":"Milestone type, e.g. first_steps"},"category":{"type":"string","enum":["DEVELOPMENTAL","EMOTIONAL","EXPERIENTIAL"]},"title":{"type":"string"},"displayText":{"type":"string"},"observedAt":{"format":"date-time","type":"string"},"place":{"type":"string"},"notes":{"type":"string"},"assets":{"type":"array","items":{"$ref":"#/components/schemas/MemoryAssetResponseDto"}}},"required":["id","type","category","observedAt","assets"]},"TimelineItemDto":{"type":"object","properties":{"kind":{"type":"string","enum":["memory","first"]},"date":{"format":"date-time","type":"string","description":"Date driving the timeline order"},"memory":{"$ref":"#/components/schemas/MemoryResponseDto"},"first":{"$ref":"#/components/schemas/FirstResponseDto"}},"required":["kind","date"]},"PersonResponseDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"relationship":{"type":"string"},"avatarFileId":{"type":"string"},"avatarUrl":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"}},"required":["id","name"]},"MemoryHubFeatureDto":{"type":"object","properties":{"featureKey":{"type":"string"},"isPremium":{"type":"boolean"},"enforcementEnabled":{"type":"boolean"}},"required":["featureKey","isPremium","enforcementEnabled"]},"HomeResponseDto":{"type":"object","properties":{"babyAvatarUrl":{"type":"string"},"babyBirthday":{"format":"date-time","type":"string"},"hero":{"description":"Hero: latest visible memory (prefers one with a photo/video)","allOf":[{"$ref":"#/components/schemas/MemoryResponseDto"}]},"onThisDay":{"type":"array","items":{"$ref":"#/components/schemas/MemoryResponseDto"}},"thisWeek":{"type":"array","items":{"$ref":"#/components/schemas/MemoryResponseDto"}},"timeline":{"description":"Timeline preview","type":"array","items":{"$ref":"#/components/schemas/TimelineItemDto"}},"firsts":{"type":"array","items":{"$ref":"#/components/schemas/FirstResponseDto"}},"voice":{"type":"array","items":{"$ref":"#/components/schemas/MemoryAssetResponseDto"}},"artwork":{"type":"array","items":{"$ref":"#/components/schemas/MemoryAssetResponseDto"}},"video":{"type":"array","items":{"$ref":"#/components/schemas/MemoryAssetResponseDto"}},"favoriteBooks":{"type":"array","items":{"$ref":"#/components/schemas/MemoryResponseDto"}},"resurfaced":{"$ref":"#/components/schemas/MemoryResponseDto"},"people":{"type":"array","items":{"$ref":"#/components/schemas/PersonResponseDto"}},"features":{"type":"array","items":{"$ref":"#/components/schemas/MemoryHubFeatureDto"}}},"required":["onThisDay","thisWeek","timeline","firsts","voice","artwork","video","favoriteBooks","people","features"]},"MemoryResurfacingPreferenceResponseDto":{"type":"object","properties":{"userId":{"type":"string"},"babyId":{"type":"string"},"enabled":{"type":"boolean"},"cadenceDays":{"type":"number"},"lastNotifiedAt":{"format":"date-time","type":"string","nullable":true}},"required":["userId","babyId","enabled","cadenceDays","lastNotifiedAt"]},"UpdateMemoryResurfacingPreferenceDto":{"type":"object","properties":{"enabled":{"type":"boolean"},"cadenceDays":{"type":"number","enum":[1,7,30],"description":"Daily, weekly or monthly"}},"required":["enabled","cadenceDays"]},"TimelineResponseDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TimelineItemDto"}},"total":{"type":"number","description":"Total memories + firsts matching the filters"},"skip":{"type":"number"},"take":{"type":"number"}},"required":["items","total","skip","take"]},"FirstsListResponseDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FirstResponseDto"}},"total":{"type":"number"},"skip":{"type":"number"},"take":{"type":"number"}},"required":["items","total","skip","take"]},"CreateFirstDto":{"type":"object","properties":{"category":{"type":"string","enum":["DEVELOPMENTAL","EMOTIONAL","EXPERIENTIAL"]},"type":{"type":"string","example":"first_steps"},"title":{"type":"string","example":"First steps"},"observedAt":{"type":"string","description":"When the first was observed (ISO 8601)"},"notes":{"type":"string"},"place":{"type":"string"},"assetIds":{"type":"array","items":{"type":"string"}}},"required":["category","type","title","observedAt"]},"AssetRoomResponseDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MemoryAssetResponseDto"}},"total":{"type":"number"},"skip":{"type":"number"},"take":{"type":"number"}},"required":["items","total","skip","take"]},"CreatePersonDto":{"type":"object","properties":{"name":{"type":"string","description":"Name, e.g. Grandma Rosa"},"relationship":{"type":"string","description":"Relationship to the child, free-form (mum, teacher, dog…)"},"avatarFileId":{"type":"string","description":"File id of an avatar image"},"phone":{"type":"string","description":"Optional contact phone"},"email":{"type":"string","description":"Optional contact email"}},"required":["name"]},"UpdatePersonDto":{"type":"object","properties":{"name":{"type":"string","description":"Name"},"relationship":{"type":"string","description":"Relationship to the child"},"avatarFileId":{"type":"string","description":"File id of an avatar image"},"phone":{"type":"string","description":"Optional contact phone"},"email":{"type":"string","description":"Optional contact email"}}},"UpdateMemoryDto":{"type":"object","properties":{"title":{"type":"string","description":"Short title"},"rawInput":{"type":"string","description":"The parent’s own words"},"displayText":{"type":"string","description":"Display text. When rawInput is sent without displayText, displayText follows rawInput."},"memoryDate":{"type":"string","description":"When it happened (ISO 8601)"},"place":{"type":"string","description":"Where it happened"},"tags":{"description":"Free-form tags","type":"array","items":{"type":"string"}},"personIds":{"description":"Person ids to tag — replaces the current set","type":"array","items":{"type":"string"}},"attributes":{"type":"object","description":"Type-specific extras"}}},"ProposeCarePlanScheduleDto":{"type":"object","properties":{"days_of_week":{"description":"Days the routine applies to. 0 = Sunday .. 6 = Saturday.","example":[0,1,2,3,4,5,6],"type":"array","items":{"type":"string"}},"start_minutes":{"type":"number","description":"Routine start, minutes after local midnight.","example":1125}},"required":["days_of_week","start_minutes"]},"ProposeCarePlanStepDto":{"type":"object","properties":{"key":{"type":"string","description":"Step key from the hub vocabulary (GET /v1/companion/care-plan-steps).","example":"warm_bath"},"offset_minutes":{"type":"number","description":"Minutes after the routine start time.","example":0}},"required":["key","offset_minutes"]},"ProposeCarePlanDto":{"type":"object","properties":{"companion_session_id":{"type":"string","description":"Server-owned id for the authenticated Companion session"},"hub_id":{"type":"string","description":"Hub the routine belongs to."},"plan_type_key":{"type":"string","description":"Distinguishes concurrent plans within one hub.","default":"routine"},"goal":{"type":"string","description":"Short goal the parent will see. It is the Sleep Priority Card title, so at most 36 characters.","example":"Longer first stretch","maxLength":36},"target_nights":{"type":"number","description":"Programme length in scheduled nights, for \"Night 2 of 7\".","example":7},"schedule":{"$ref":"#/components/schemas/ProposeCarePlanScheduleDto"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/ProposeCarePlanStepDto"}},"rationale":{"type":"string","description":"One line the parent reads with the suggestion. Not a rationale for the model. It is the Sleep Priority Card teaser, so at most 68 characters.","example":"Three night wakings this week — a calmer wind-down may help.","maxLength":68}},"required":["companion_session_id","hub_id","schedule","steps"]},"WithdrawCarePlanProposalDto":{"type":"object","properties":{"companion_session_id":{"type":"string","description":"Server-owned id for the authenticated Companion session"},"hub_id":{"type":"string","description":"Hub the routine belongs to."},"plan_type_key":{"type":"string","description":"Distinguishes concurrent plans within one hub.","default":"routine"}},"required":["companion_session_id","hub_id"]},"LogEventDto":{"type":"object","properties":{"user_id":{"type":"string","description":"Bubu user id (from the ElevenLabs session)"},"baby_id":{"type":"string","description":"Baby id the action is about"},"companion_session_id":{"type":"string","description":"Server-owned id for the authenticated Companion session"},"type":{"type":"string","enum":["nap","overnight_sleep","night_waking","milestone"]},"value":{"type":"string","description":"Type-specific payload as a JSON object string, e.g. {\"start\":\"..\",\"notes\":\"..\"}"},"occurred_at":{"type":"string","description":"ISO datetime; defaults to now"}},"required":["user_id","baby_id","companion_session_id","type"]},"CompanionActionPreviewDto":{"type":"object","properties":{"title":{"type":"string","description":"Short human-readable action title"},"targetBabyId":{"type":"string","description":"Child whose data or reminder will be changed"},"targetBabyName":{"type":"string","nullable":true},"effect":{"type":"string","description":"Plain-language description of the side effect"},"destination":{"type":"string","description":"Owning in-app destination for the result"},"parameters":{"type":"object","additionalProperties":true}},"required":["title","targetBabyId","effect","destination","parameters"]},"CompanionActionReceiptDto":{"type":"object","properties":{"outcome":{"type":"string","enum":["pending","completed","partial","failed","duplicate_prevented","cancelled"]},"result":{"type":"object","additionalProperties":true,"nullable":true},"error":{"type":"string","nullable":true},"occurredAt":{"type":"string","description":"ISO timestamp for this receipt state"}},"required":["outcome","occurredAt"]},"CompanionActionProposalResponseDto":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string","enum":["reminder","save_note","log_event","add_hub_update"]},"status":{"type":"string","enum":["pending","executing","completed","failed","cancelled","expired"]},"babyId":{"type":"string"},"preview":{"$ref":"#/components/schemas/CompanionActionPreviewDto"},"receipt":{"$ref":"#/components/schemas/CompanionActionReceiptDto"},"duplicatePrevented":{"type":"boolean","description":"True when a retry was handled without re-execution"},"requiresConfirmation":{"type":"boolean","description":"True only while caregiver confirmation is still required"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"}},"required":["id","action","status","babyId","preview","receipt","duplicatePrevented","requiresConfirmation","createdAt","expiresAt"]},"SaveNoteDto":{"type":"object","properties":{"user_id":{"type":"string","description":"Bubu user id (from the ElevenLabs session)"},"baby_id":{"type":"string","description":"Baby id the action is about"},"companion_session_id":{"type":"string","description":"Server-owned id for the authenticated Companion session"},"kind":{"type":"string","enum":["memory","parental_observation","biography_note","routine_note"]},"text":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}},"required":["user_id","baby_id","companion_session_id","kind","text"]},"ReminderDto":{"type":"object","properties":{"user_id":{"type":"string","description":"Bubu user id (from the ElevenLabs session)"},"baby_id":{"type":"string","description":"Baby id the action is about"},"companion_session_id":{"type":"string","description":"Server-owned id for the authenticated Companion session"},"action":{"type":"string","enum":["create","update","snooze","cancel","complete"]},"reminder_type":{"type":"string","enum":["medication","vaccine","doctor_appointment","hydration","pee","poop","diaper_change","potty_sit","bedtime","nap","feed","pumping","supplement","developmental_activity","speech_practice","tummy_time","brushing_teeth","nursery_pickup","packing","travel_prep","symptom_follow_up","growth_measurement","routine_reset","custom","diaper"],"description":"`diaper` is accepted as a legacy alias for `diaper_change`"},"schedule":{"type":"string","description":"Concrete local ISO datetime interpreted in the server-resolved session timezone, ISO datetime with Z/offset, or a positive ISO duration such as PT30M. Template placeholders are not accepted."},"recurrence":{"type":"string","description":"Optional RRULE subset: FREQ=DAILY|WEEKLY with optional INTERVAL"},"message":{"type":"string"},"reminder_id":{"type":"string"}},"required":["user_id","baby_id","companion_session_id","action"]},"AddHubUpdateDto":{"type":"object","properties":{"user_id":{"type":"string","description":"Bubu user id (from the ElevenLabs session)"},"baby_id":{"type":"string","description":"Baby id the action is about"},"companion_session_id":{"type":"string","description":"Server-owned id for the authenticated Companion session"},"hub":{"type":"string"},"update_type":{"type":"string"},"payload":{"type":"string","description":"The update content as a JSON object string"}},"required":["user_id","baby_id","companion_session_id","hub","update_type","payload"]},"CreatePlanDto":{"type":"object","properties":{"user_id":{"type":"string","description":"Bubu user id (from the ElevenLabs session)"},"baby_id":{"type":"string","description":"Baby id the action is about"},"companion_session_id":{"type":"string","description":"Server-owned id for the authenticated Companion session"},"plan_type":{"type":"string","enum":["today","bedtime","weekend_activity","routine_adjustment","meal","packing","nursery_bag","travel","doctor_visit_prep","symptom_observation","potty_training","sleep_transition","nap_transition","feeding_transition","weaning","developmental_practice","family_routine","follow_up_tasks"]},"title":{"type":"string","description":"Short editable plan title"},"items":{"type":"string","description":"Editable checklist items as a JSON array of strings","example":"[\"Pack nappies\", \"Pack a change of clothes\"]"},"context":{"type":"string","description":"Optional context as a JSON object string"}},"required":["user_id","baby_id","companion_session_id","plan_type","items"]},"PlayMediaDto":{"type":"object","properties":{"user_id":{"type":"string","description":"Bubu user id (from the ElevenLabs session)"},"baby_id":{"type":"string","description":"Baby id the action is about"},"companion_session_id":{"type":"string","description":"Server-owned id for the authenticated Companion session"},"media_type":{"type":"string","enum":["bedtime_audio","calming_audio","white_noise","sleep_education"]},"ref":{"type":"string"}},"required":["user_id","baby_id","companion_session_id","media_type"]},"LaunchContentDto":{"type":"object","properties":{"user_id":{"type":"string","description":"Bubu user id (from the ElevenLabs session)"},"baby_id":{"type":"string","description":"Baby id the action is about"},"companion_session_id":{"type":"string","description":"Server-owned id for the authenticated Companion session"},"content_type":{"type":"string","enum":["article","tips","quiz","questionnaire","profile_survey","media_audio_lesson","media_video","media_image","routine_guide","parenting_exercise","speech_practice","feeding_guidance","potty_training","age_activity"]},"ref":{"type":"string"}},"required":["user_id","baby_id","companion_session_id","content_type","ref"]},"GenerateSummaryDto":{"type":"object","properties":{"user_id":{"type":"string","description":"Bubu user id (from the ElevenLabs session)"},"baby_id":{"type":"string","description":"Baby id the action is about"},"companion_session_id":{"type":"string","description":"Server-owned id for the authenticated Companion session"},"scope":{"type":"string","enum":["logs","memories"]},"period":{"type":"string","enum":["daily","weekly","monthly"]}},"required":["user_id","baby_id","companion_session_id","scope","period"]},"DraftMessageDto":{"type":"object","properties":{"user_id":{"type":"string","description":"Bubu user id (from the ElevenLabs session)"},"baby_id":{"type":"string","description":"Baby id the action is about"},"companion_session_id":{"type":"string","description":"Server-owned id for the authenticated Companion session"},"recipient":{"type":"string","enum":["nursery","co_parent","caregiver","doctor"]},"kind":{"type":"string","enum":["update","question_list","handover","reassurance"]},"message":{"type":"string","description":"Editable message draft for the parent to review"},"context":{"type":"string","description":"Optional context as a JSON object string"}},"required":["user_id","baby_id","companion_session_id","recipient","kind","message"]},"TranslateEmailReplyDto":{"type":"object","properties":{"user_id":{"type":"string","description":"Bubu user id (from the ElevenLabs session)"},"baby_id":{"type":"string","description":"Baby id the action is about"},"companion_session_id":{"type":"string","description":"Server-owned id for the authenticated Companion session"},"text":{"type":"string","description":"The agreed reply, in the parent's language"}},"required":["user_id","baby_id","companion_session_id","text"]},"ProposeEmailReplyDto":{"type":"object","properties":{"user_id":{"type":"string","description":"Bubu user id (from the ElevenLabs session)"},"baby_id":{"type":"string","description":"Baby id the action is about"},"companion_session_id":{"type":"string","description":"Server-owned id for the authenticated Companion session"},"text":{"type":"string","description":"The exact text the parent approved"},"language":{"type":"string","enum":["parent","email"]}},"required":["user_id","baby_id","companion_session_id","text","language"]},"EditCompanionActionProposalDto":{"type":"object","properties":{"changes":{"type":"object","additionalProperties":true,"description":"Action-specific fields to change. Identity, child, session, and action family are immutable."}},"required":["changes"]},"CompanionOpenerResponseDto":{"type":"object","properties":{"message":{"type":"string","description":"Privacy-safe cold-launch opener"},"babyId":{"type":"string","description":"Server-verified selected child id"},"source":{"type":"string","enum":["selected_child","neutral_fallback","session_purpose","companion_prompt"]}},"required":["message","babyId","source"]},"StartCompanionSessionDto":{"type":"object","properties":{"babyId":{"type":"string","description":"The child this companion session is about"},"agentType":{"type":"string","enum":["companion","sleep_companion","school_companion","school_ask"],"default":"companion","description":"Which Bubu companion to start. Omit for the main Bubu Companion."},"purpose":{"type":"string","enum":["sleep_onboarding_concerns","email_reply"],"description":"Server-owned session purpose. \"sleep_onboarding_concerns\" starts the final sleep-onboarding concern conversation: the approved purpose-specific opener replaces the default, and the purpose is recorded on the session for post-call routing. \"email_reply\" is a conversation about one school email; it needs agentType \"school_companion\", familyActionId and gmailMessageId. Omit for a regular chat."},"promptId":{"type":"string","description":"Owned proactive prompt id. The server uses its text as the opener and its configured agent; it cannot be combined with purpose."},"familyActionId":{"type":"string","description":"email_reply only: the family action the email produced"},"gmailMessageId":{"type":"string","description":"email_reply only: the email's Gmail message id (the source's external_ref)"}},"required":["babyId"]},"CompanionStartVariablesDto":{"type":"object","properties":{"user_id":{"type":"string","description":"Server-verified Bubu user id for ElevenLabs tools"},"baby_id":{"type":"string","description":"Server-verified child id for ElevenLabs tools"},"companion_session_id":{"type":"string","description":"Opaque session id; resolves server-side to the validated (userId, babyId)"},"parent_name":{"type":"string","description":"Parent's first name, or empty"},"user_name":{"type":"string","description":"Parent's first name, or empty. Alias of parent_name; some ElevenLabs agent templates reference user_name"},"child_name":{"type":"string","description":"Child name, or \"your little one\" if not set"},"child_age_label":{"type":"string","description":"e.g. \"8 months\", or empty when no birth date"},"child_pronouns":{"type":"string","description":"she/her, he/him, or empty"},"language":{"type":"string","description":"Short language code, e.g. \"en\""},"locale":{"type":"string","description":"Full locale, e.g. \"en-GB\""},"timezone":{"type":"string","description":"IANA timezone, or empty"},"current_date":{"type":"string","description":"Current local date in YYYY-MM-DD format, or empty"},"current_time":{"type":"string","description":"Current local time in HH:mm:ss format, or empty"},"materialized_context_json":{"type":"string","description":"Compact precomputed child context as JSON, or empty when unavailable"},"context_generated_at":{"type":"string","description":"When the materialized context was generated, or empty"},"companion_prompt_id":{"type":"string","description":"Proactive prompt id, or empty"},"companion_prompt_action_id":{"type":"string","description":"Validated prompt action id, or empty"},"reply_sender_name":{"type":"string","description":"email_reply only, otherwise empty: the sender's display name"},"reply_sender_address":{"type":"string","description":"email_reply only, otherwise empty: the sender's address"},"reply_subject":{"type":"string","description":"email_reply only, otherwise empty: the email's subject"},"reply_received_at":{"type":"string","description":"email_reply only, otherwise empty: ISO time the email was received"},"reply_body":{"type":"string","description":"email_reply only, otherwise empty: the plain-text body, capped"},"reply_body_truncated":{"type":"string","description":"email_reply only, otherwise empty: \"true\" when the body was cut"},"reply_summary":{"type":"string","description":"email_reply only, otherwise empty: Bubu's summary of the email"},"reply_email_language":{"type":"string","description":"email_reply only, otherwise empty: the email's language as a primary code, or empty when unknown"},"reply_to_address":{"type":"string","description":"email_reply only, otherwise empty: the address Send delivers to (Reply-To, else From); show it as the To line"},"school_context":{"type":"string","description":"school_ask only, otherwise empty: the school items from the last 14 days, one per line"},"contextual_opener":{"type":"string","description":"Privacy-safe opener shown before session start"}},"required":["user_id","baby_id","companion_session_id","parent_name","user_name","child_name","child_age_label","child_pronouns","language","locale","timezone","current_date","current_time","materialized_context_json","context_generated_at","companion_prompt_id","companion_prompt_action_id","reply_sender_name","reply_sender_address","reply_subject","reply_received_at","reply_body","reply_body_truncated","reply_summary","reply_email_language","reply_to_address","school_context","contextual_opener"]},"CompanionVoiceHandoffDto":{"type":"object","properties":{"dynamicVariables":{"description":"Flat dynamic-variable bag. The client MUST pass these into the ElevenLabs SDK at conversation start — they are NOT carried by signedUrl.","allOf":[{"$ref":"#/components/schemas/CompanionStartVariablesDto"}]},"signedUrl":{"type":"string","nullable":true,"description":"ElevenLabs signed URL for the companion agent. Null if the fetch failed (caller may retry)."},"agentId":{"type":"string","nullable":true,"description":"The companion agent id the signed URL was issued for."}},"required":["dynamicVariables"]},"CompanionSessionStartResponseDto":{"type":"object","properties":{"voiceHandoff":{"description":"Voice handoff (same shape as onboarding): the client passes voiceHandoff.dynamicVariables into the ElevenLabs SDK and starts the conversation with voiceHandoff.signedUrl.","allOf":[{"$ref":"#/components/schemas/CompanionVoiceHandoffDto"}]},"opener":{"$ref":"#/components/schemas/CompanionOpenerResponseDto"}},"required":["voiceHandoff","opener"]},"CompanionAttachmentResponseDto":{"type":"object","properties":{"fileId":{"type":"string","description":"ElevenLabs file id; pass to sendMultimodalMessage as { file: { type: \"file_input\", file_id } }","example":"019f6638-caba-74df-854e-231383d94012"},"conversationId":{"type":"string","description":"The conversation the file was attached to"}},"required":["fileId","conversationId"]},"ReminderCardActionDto":{"type":"object","properties":{"action":{"type":"string","enum":["complete","snooze","cancel"]},"schedule":{"type":"string","description":"Required for snooze: ISO datetime with Z/offset or a relative ISO duration such as PT30M"},"actionRequestId":{"type":"string","description":"Client-generated id used to deduplicate action retries"}},"required":["action"]},"SendReplyDto":{"type":"object","properties":{"gmailMessageId":{"type":"string","description":"The email's Gmail message id (the source's external_ref)"},"sendText":{"type":"string","description":"The exact text to send"},"actionRequestId":{"type":"string","description":"One per Send tap; a replay sends once"}},"required":["gmailMessageId","sendText","actionRequestId"]},"CreateManualActionDto":{"type":"object","properties":{}},"FamilyActionCommandDto":{"type":"object","properties":{"action":{"type":"string","enum":["complete","reopen","dismiss","assign","edit","answer","request_handover","cancel_handover","accept_handover","decline_handover","undo_handover","keep_duty"]},"expectedVersion":{"type":"number","description":"The version the client last saw. A mismatch returns 409 and the client refetches."},"actionRequestId":{"type":"string","description":"Client-generated id used to deduplicate retries"},"assigneeUserId":{"type":"string","nullable":true,"description":"assign: the user to hand it to, or null to unassign"},"title":{"type":"string"},"type":{"type":"string","enum":["event","task"],"description":"edit: switch a hand-added item between event and to-do"},"location":{"type":"string","nullable":true},"dueAt":{"type":"string","nullable":true},"startsAt":{"type":"string","nullable":true},"endsAt":{"type":"string","nullable":true},"allDay":{"type":"boolean"},"childIds":{"description":"edit: correct which children this is about (PRD §5.3)","type":"array","items":{"type":"string"}},"toUserId":{"type":"string","description":"request_handover: the care-team member asked to take the duty"},"answer":{"type":"string","description":"answer: one of the question's clarification_options (YYYY-MM-DD)"}},"required":["action"]},"ConnectGoogleDto":{"type":"object","properties":{"serverAuthCode":{"type":"string","description":"The one-time server auth code from the native Google picker"},"scopes":{"description":"What the app asked for; the server reads the real grant from Google","type":"array","items":{"type":"string"}},"expectedAccount":{"type":"string","description":"Adding a scope to this connection (gmail.send, calendar.freebusy): the account Google must return. Another account is refused (409 ACCOUNT_MISMATCH) instead of replacing the connection."}},"required":["serverAuthCode","scopes"]},"UpdateGoogleConnectionDto":{"type":"object","properties":{"paused":{"type":"boolean"},"selectedCalendarIds":{"description":"The calendars Bubu may read; others are deselected","type":"array","items":{"type":"string"}},"schoolSenders":{"description":"Who sends school email: an address or @domain. Replaces the list; intake reads only these senders.","type":"array","items":{"type":"string"}},"schoolSenderLanguages":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"A language per school sender (an app language code, or null for the email's own). Replaces the map."},"availabilityEnabled":{"type":"boolean","description":"Share my availability (family-coverage.md FC-3): free or busy only, never what the event is"}}},"ParseFamilyActionDto":{"type":"object","properties":{}},"FamilyAvailabilityDto":{"type":"object","properties":{"babyId":{"type":"string","description":"The child whose care team is asked about"},"userIds":{"type":"array","items":{"type":"string"}},"from":{"type":"string"},"to":{"type":"string","description":"At most 7 days after `from`"}},"required":["babyId","userIds","from","to"]},"ResponsibilityItemDto":{"type":"object","properties":{"kind":{"type":"string","enum":["pickup","drop_off"]},"weekday":{"type":"number","description":"ISO weekday, 1 = Monday"},"time":{"type":"string","description":"Local wall-clock 'HH:mm' in `timezone`"},"durationMinutes":{"type":"number","default":15},"place":{"type":"string","nullable":true},"ownerUserId":{"type":"string","nullable":true,"description":"Who usually does it; on the child's care team"},"timezone":{"type":"string","description":"IANA zone the time is in"}},"required":["kind","weekday","time","timezone"]},"SaveResponsibilitiesDto":{"type":"object","properties":{"items":{"description":"Replaces the set","type":"array","items":{"$ref":"#/components/schemas/ResponsibilityItemDto"}},"expectedVersion":{"type":"number","description":"The version GET returned; a mismatch is 409"}},"required":["items","expectedVersion"]},"FamilyNotificationsDto":{"type":"object","properties":{"pickupAlerts":{"type":"boolean","description":"Coverage pushes: a clash, a handover, an escalation"},"eveningReminder":{"type":"boolean","description":"The 7pm push about tomorrow (school-inbox-companion SC-1)"},"eventReminders":{"type":"boolean","description":"The reminders 2 hours and 1 hour before anything with a time"}}},"FamilyCalendarSettingsDto":{"type":"object","properties":{"autoAdd":{"type":"boolean","description":"Add school events to the calendar without a tap (D-16: offered after the first one)"},"writeCalendarId":{"type":"string","nullable":true,"description":"One of the person's own Google calendars; null writes to the primary one"}}},"UpdateFamilySettingsDto":{"type":"object","properties":{"onboardingCompleted":{"type":"number","enum":[true],"description":"Only true: sets onboarding_completed_at once, never clears it"},"notifications":{"$ref":"#/components/schemas/FamilyNotificationsDto"},"calendar":{"$ref":"#/components/schemas/FamilyCalendarSettingsDto"}}},"VoiceProfileResponseDto":{"type":"object","properties":{"id":{"type":"string","example":"clv_voice_profile_id"},"name":{"type":"string","example":"Mom's Voice"},"provider":{"type":"string","example":"elevenlabs"},"externalVoiceId":{"type":"string","example":"c38kUX8pkfYO2kHyqfFy","description":"Provider voice id. Clients normally use profile id for Bubu APIs; this is returned for transparency/debugging."},"language":{"type":"string","example":"en-GB","nullable":true},"status":{"type":"string","example":"READY"},"sampleCount":{"type":"number","example":3},"totalSampleBytes":{"type":"number","example":6382041},"requiresVerification":{"type":"boolean","example":false},"createdAt":{"format":"date-time","type":"string","example":"2026-07-09T10:00:00.000Z"},"updatedAt":{"format":"date-time","type":"string","example":"2026-07-09T10:00:00.000Z"}},"required":["id","name","provider","externalVoiceId","status","sampleCount","totalSampleBytes","requiresVerification","createdAt","updatedAt"]},"VoiceProfileListResponseDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/VoiceProfileResponseDto"}}},"required":["items"]},"PreviewVoiceProfileDto":{"type":"object","properties":{"text":{"type":"string","example":"Hi, I'm your Bubu storyteller. I'm ready to tell magical bedtime stories.","description":"Preview text to synthesize. Defaults to a short Bubu storyteller line.","maxLength":500}}},"DeleteVoiceProfileResponseDto":{"type":"object","properties":{"ok":{"type":"boolean","example":true}},"required":["ok"]},"CategoryDto":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"displayOrder":{"type":"number"},"parentCategoryId":{"type":"string"},"language":{"type":"string"},"media":{"readOnly":true,"type":"array","items":{"type":"string"}},"mediaCount":{"type":"number","readOnly":true}},"required":["name"]},"PaginatedMediaDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MediaDto"}},"skip":{"type":"number"},"take":{"type":"number"},"total":{"type":"number"},"nextCursor":{"type":"string","description":"Cursor for the next page of results"}},"required":["data","skip","take","total"]},"CreateCustomStoryDto":{"type":"object","properties":{"title":{"type":"string"},"language":{"type":"string","example":"en-GB"},"description":{"type":"string"},"lyrics":{"type":"string"},"fileIds":{"description":"IDs of files to attach","type":"array","items":{"type":"string"}},"categoryIds":{"description":"IDs of categories to attach","type":"array","items":{"type":"string"}},"tagIds":{"description":"IDs of tags to attach","type":"array","items":{"type":"string"}},"slug":{"type":"string","description":"Optional custom slug"},"story_vibe":{"type":"string"},"story_plot":{"type":"string"},"lesson_message":{"type":"string"},"narrator_style":{"type":"string"},"personal_touch":{"type":"string"}},"required":["title","language"]},"FeedbackDto":{"type":"object","properties":{"value":{"type":"number","description":"The value of the feedback, for thumbs up is 1 and for thumbs down is -1","example":1}},"required":["value"]},"RecordProgressDto":{"type":"object","properties":{"progress":{"type":"number","description":"Percentage of the media that has been played"}},"required":["progress"]},"CreateMediaDto":{"type":"object","properties":{"title":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string"},"lyrics":{"type":"string"},"type":{"type":"string"},"artist":{"type":"string","readOnly":true},"language":{"type":"string"},"files":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/FileDto"}},"tags":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/TagDto"}},"categories":{"readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/MediaCategoryDto"}},"featured":{"type":"boolean"},"userFavorite":{"type":"boolean","readOnly":true},"userFeedback":{"type":"number","readOnly":true},"userProgress":{"type":"number","readOnly":true},"customStoryMetadata":{"$ref":"#/components/schemas/CustomStoryMetadataDto"}},"required":["title","slug","description","lyrics","type"]},"CreateStoryRequestDto":{"type":"object","properties":{"theme":{"type":"string","description":"The theme of the story (defaults to Friendship if not provided)","enum":["Friendship","Magic","Adventure","Kindness","Courage","Family","Animals","Nature","Dreams","Sharing",""],"example":"Friendship"},"value":{"type":"string","description":"The moral or value to teach in the story (defaults to Kindness if not provided)","enum":["Kindness","Courage","Honesty","Sharing","Friendship","Patience","Gratitude","Empathy","Respect","Responsibility",""],"example":"Kindness"},"vibe":{"type":"string","description":"The overall vibe or feeling of the story","example":"Magical","maxLength":100},"plot":{"type":"string","description":"The specific plot or situation for the story","example":"A fairy grants one bedtime wish","maxLength":200},"lesson":{"type":"string","description":"The lesson or message to teach in the story","example":"kindness","maxLength":100},"narratorStyle":{"type":"string","description":"The narrator style for the story (defaults to \"gentle storyteller\" if not provided)","example":"gentle grandparent","maxLength":100},"personalTouch":{"type":"string","description":"Any personal touches to include in the story","example":"Include a mention of their new baby sister","maxLength":200},"language":{"type":"string","description":"The language for the story (defaults to en-US if not provided)","example":"en-US"},"babyId":{"type":"string","description":"ID of the baby for whom the story is being created","example":"clp1234567890abcdef"},"voiceProfileId":{"type":"string","description":"ID of the caller's cloned voice profile to narrate the story audio. Must be owned by the caller, READY, and verified; the request is rejected before generation starts otherwise. Omit for the default Bubu narrator for the story language.","example":"clv1234567890abcdef","maxLength":64}}},"StoryProgressDto":{"type":"object","properties":{"status":{"type":"string","description":"Current status of the story generation","enum":["PENDING","PROCESSING","GENERATING_STORY","GENERATING_TITLE","GENERATING_IMAGE","GENERATING_AUDIO","UPLOADING_FILES","COMPLETED","FAILED"]},"message":{"type":"string","description":"Progress message"},"progress":{"type":"number","description":"Progress percentage (0-100)","minimum":0,"maximum":100},"error":{"type":"string","description":"Error message if failed"}},"required":["status"]},"StoryFileDto":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"fileType":{"type":"string","description":"File type","example":"audio"},"url":{"type":"string","description":"File URL"},"duration":{"type":"number","description":"File duration in seconds (for audio files)"}},"required":["id","fileType","url"]},"StoryResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the story generation request"},"title":{"type":"string","description":"Story title"},"content":{"type":"string","description":"Story content"},"status":{"type":"string","description":"Current status","enum":["PENDING","PROCESSING","GENERATING_STORY","GENERATING_TITLE","GENERATING_IMAGE","GENERATING_AUDIO","UPLOADING_FILES","COMPLETED","FAILED"]},"theme":{"type":"string","description":"Theme used","enum":["Friendship","Magic","Adventure","Kindness","Courage","Family","Animals","Nature","Dreams","Sharing",""]},"value":{"type":"string","description":"Value/moral taught","enum":["Kindness","Courage","Honesty","Sharing","Friendship","Patience","Gratitude","Empathy","Respect","Responsibility",""]},"language":{"type":"string","description":"Language used"},"files":{"description":"Generated files","type":"array","items":{"$ref":"#/components/schemas/StoryFileDto"}},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp"},"updatedAt":{"format":"date-time","type":"string","description":"Last update timestamp"},"error":{"type":"string","description":"Error message if failed"}},"required":["id","title","content","status","theme","value","language","files","createdAt","updatedAt"]},"StoryListResponseDto":{"type":"object","properties":{"stories":{"description":"List of stories","type":"array","items":{"$ref":"#/components/schemas/StoryResponseDto"}},"total":{"type":"number","description":"Total count"},"page":{"type":"number","description":"Page number"},"limit":{"type":"number","description":"Items per page"}},"required":["stories","total","page","limit"]},"ChatMessageDto":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"},"sentAt":{"type":"number"}},"required":["role","content","sentAt"]},"ChatHistoryDto":{"type":"object","properties":{"history":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessageDto"}}},"required":["history"]},"PaginatedChatHistoryDto":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessageDto"}},"total":{"type":"number","description":"Total number of messages in chat history"},"nextCursor":{"type":"string","description":"Cursor for the next page (ID of the oldest message in this page)"},"hasNextPage":{"type":"boolean","description":"Whether there are more messages to load"}},"required":["messages","total","hasNextPage"]},"FeedResponseDto":{"type":"object","properties":{"favourites":{"$ref":"#/components/schemas/PaginatedMediaDto"},"recommended":{"$ref":"#/components/schemas/PaginatedMediaDto"},"newlyReleased":{"$ref":"#/components/schemas/PaginatedMediaDto"}}},"FeedCategoryWithMediaDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"displayOrder":{"type":"number"},"parentCategoryId":{"type":"string"},"language":{"type":"string"},"media":{"type":"array","items":{"$ref":"#/components/schemas/MediaDto"}},"subCategories":{"type":"array","items":{"$ref":"#/components/schemas/FeedCategoryWithMediaDto"}}},"required":["id","name","media"]},"CreateUserProfileDto":{"type":"object","properties":{"userId":{"type":"string","description":"User ID"},"firstName":{"type":"string","description":"First name of the user"},"lastName":{"type":"string","description":"Last name of the user"},"birthDate":{"format":"date-time","type":"string","description":"Birth date of the user"},"gender":{"type":"string","description":"Gender of the user"},"location":{"type":"string","description":"Location (City and Country format)"},"profilePictureUrl":{"type":"string","description":"Profile picture URL"},"languagesSpoken":{"description":"Languages spoken at home","type":"array","items":{"type":"string"}},"parentingMethods":{"description":"Parenting methods","type":"array","items":{"type":"string"}},"hobbies":{"description":"Hobbies","type":"array","items":{"type":"string"}},"parentingExperience":{"type":"string","description":"Parenting experience"},"interestedTopics":{"description":"Interested topics","type":"array","items":{"type":"string"}},"supportSystem":{"description":"Support system","type":"array","items":{"type":"string"}},"religion":{"type":"string","description":"Religion"},"livingEnvironment":{"type":"string","description":"Living environment"},"hasPet":{"type":"boolean","description":"Whether the user has pets"},"petTypes":{"description":"Pet types","type":"array","items":{"type":"string"}},"petName":{"type":"string","description":"Pet name"}},"required":["userId"]},"ProfileCompletionDto":{"type":"object","properties":{"completionPercentage":{"type":"number","description":"Overall completion percentage (0-100)","example":75},"profileCompletionPercentage":{"type":"number","description":"User profile completion percentage (0-100)","example":80},"babyCompletionPercentage":{"type":"number","description":"Baby profile completion percentage (0-100)","example":70},"completedProfileFields":{"type":"number","description":"Number of completed profile fields","example":12},"totalProfileFields":{"type":"number","description":"Total number of profile fields","example":15},"completedBabyFields":{"type":"number","description":"Number of completed baby fields","example":7},"totalBabyFields":{"type":"number","description":"Total number of baby fields","example":9},"hasBaby":{"type":"boolean","description":"Whether user has at least one baby","example":true},"missingProfileFields":{"description":"Missing profile fields","example":["firstName","birthDate","location"],"type":"array","items":{"type":"string"}},"missingBabyFields":{"description":"Missing baby fields (for the most complete baby)","example":["name","birthDate"],"type":"array","items":{"type":"string"}}},"required":["completionPercentage","profileCompletionPercentage","babyCompletionPercentage","completedProfileFields","totalProfileFields","completedBabyFields","totalBabyFields","hasBaby","missingProfileFields","missingBabyFields"]},"UserProfileResponseDto":{"type":"object","properties":{"userId":{"type":"string","description":"User ID"},"firstName":{"type":"string","description":"First name of the user"},"lastName":{"type":"string","description":"Last name of the user"},"birthDate":{"format":"date-time","type":"string","description":"Birth date of the user"},"gender":{"type":"string","description":"Gender of the user"},"location":{"type":"string","description":"Location (City and Country format)"},"profilePictureUrl":{"type":"string","description":"Profile picture URL"},"languagesSpoken":{"description":"Languages spoken at home","type":"array","items":{"type":"string"}},"parentingMethods":{"description":"Parenting methods","type":"array","items":{"type":"string"}},"hobbies":{"description":"Hobbies","type":"array","items":{"type":"string"}},"parentingExperience":{"type":"string","description":"Parenting experience"},"interestedTopics":{"description":"Interested topics","type":"array","items":{"type":"string"}},"supportSystem":{"description":"Support system","type":"array","items":{"type":"string"}},"religion":{"type":"string","description":"Religion"},"livingEnvironment":{"type":"string","description":"Living environment"},"hasPet":{"type":"boolean","description":"Whether the user has pets"},"petTypes":{"description":"Pet types","type":"array","items":{"type":"string"}},"petName":{"type":"string","description":"Pet name"},"onboardingCompleted":{"type":"boolean","description":"Whether onboarding has been completed","readOnly":true},"onboardingCompletedAt":{"format":"date-time","type":"string","description":"Timestamp when onboarding was completed","readOnly":true},"completion":{"description":"Profile completion details","readOnly":true,"allOf":[{"$ref":"#/components/schemas/ProfileCompletionDto"}]},"thirdPartyAiConsentGranted":{"type":"boolean","description":"Third party AI data sharing decision. null when never asked. Set via PATCH /user/consents/ai-data-sharing.","readOnly":true,"example":true},"thirdPartyAiConsentVersion":{"type":"string","description":"Version of the consent policy the decision was recorded against.","readOnly":true,"example":"2026-08-31"},"thirdPartyAiConsentUpdatedAt":{"format":"date-time","type":"string","description":"When the decision was last recorded (server time).","readOnly":true},"thirdPartyAiConsentRequired":{"type":"boolean","description":"True when the consent screen must be shown: never asked, declined, withdrawn, or accepted against an older policy version. Only populated on GET /user/profile, which is where the client reads the gate.","readOnly":true,"example":false},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp","readOnly":true},"updatedAt":{"format":"date-time","type":"string","description":"Last update timestamp","readOnly":true}},"required":["userId","onboardingCompleted","createdAt","updatedAt"]},"UpdateUserProfileDto":{"type":"object","properties":{"firstName":{"type":"string","description":"First name of the user"},"lastName":{"type":"string","description":"Last name of the user"},"birthDate":{"format":"date-time","type":"string","description":"Birth date of the user"},"gender":{"type":"string","description":"Gender of the user"},"location":{"type":"string","description":"Location (City and Country format)"},"profilePictureUrl":{"type":"string","description":"Profile picture URL"},"languagesSpoken":{"description":"Languages spoken at home","type":"array","items":{"type":"string"}},"parentingMethods":{"description":"Parenting methods","type":"array","items":{"type":"string"}},"hobbies":{"description":"Hobbies","type":"array","items":{"type":"string"}},"parentingExperience":{"type":"string","description":"Parenting experience"},"interestedTopics":{"description":"Interested topics","type":"array","items":{"type":"string"}},"supportSystem":{"description":"Support system","type":"array","items":{"type":"string"}},"religion":{"type":"string","description":"Religion"},"livingEnvironment":{"type":"string","description":"Living environment"},"hasPet":{"type":"boolean","description":"Whether the user has pets"},"petTypes":{"description":"Pet types","type":"array","items":{"type":"string"}},"petName":{"type":"string","description":"Pet name"}}},"UserBabyResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the relationship","readOnly":true},"userId":{"type":"string","description":"User ID","readOnly":true},"babyId":{"type":"string","description":"Baby ID","readOnly":true},"baby":{"description":"Baby information","readOnly":true,"allOf":[{"$ref":"#/components/schemas/BabyResponseDto"}]},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp","readOnly":true},"updatedAt":{"format":"date-time","type":"string","description":"Last update timestamp","readOnly":true},"myRole":{"type":"string","description":"User role in the care team for this baby","enum":["OWNER","CO_PARENT","EXTENDED_FAMILY","CAREGIVER"],"readOnly":true}},"required":["id","userId","babyId","baby","createdAt","updatedAt"]},"CreateParentingTokenDto":{"type":"object","properties":{"babyIds":{"description":"Array of baby IDs to include in the co-parenting invitation","example":["00000000-0000-0000-0000-000000000000","11111111-1111-1111-1111-111111111111"],"type":"array","items":{"type":"string"}},"expiresInHours":{"type":"number","description":"Expiration time in hours (default: 72 hours/3 days)","example":72}},"required":["babyIds"]},"ParentingTokenResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the token","readOnly":true},"token":{"type":"string","description":"Secure token string used for the invitation","readOnly":true,"example":"8a7b6c5d4e3f2g1h"},"creatorUserId":{"type":"string","description":"User ID of the creator of the invitation","readOnly":true,"example":"00000000-0000-0000-0000-000000000000"},"babyIds":{"description":"Array of baby IDs included in the invitation","readOnly":true,"example":["00000000-0000-0000-0000-000000000000","11111111-1111-1111-1111-111111111111"],"type":"array","items":{"type":"string"}},"expiresAt":{"format":"date-time","type":"string","description":"Expiration date of the token","readOnly":true},"createdAt":{"format":"date-time","type":"string","description":"Creation timestamp","readOnly":true},"updatedAt":{"format":"date-time","type":"string","description":"Last update timestamp","readOnly":true}},"required":["id","token","creatorUserId","babyIds","expiresAt","createdAt","updatedAt"]},"ValidateParentingTokenDto":{"type":"object","properties":{"token":{"type":"string","description":"Token string to validate","example":"8a7b6c5d4e3f2g1h"}},"required":["token"]},"ValidateParentingTokenResponseDto":{"type":"object","properties":{"token":{"description":"The validated parenting token","allOf":[{"$ref":"#/components/schemas/ParentingTokenResponseDto"}]},"babies":{"description":"Babies included in this co-parenting invitation","type":"array","items":{"$ref":"#/components/schemas/BabyResponseDto"}}},"required":["token","babies"]},"AcceptCoParentingInviteDto":{"type":"object","properties":{"token":{"type":"string","description":"Token string of the invitation to accept","example":"8a7b6c5d4e3f2g1h"}},"required":["token"]},"UserHubResponseDto":{"type":"object","properties":{"hubId":{"type":"string","description":"Hub ID"},"slug":{"type":"string","description":"Stable machine identifier. Route and branch on THIS, never on `name` — `name` is localized (the Sleep hub is \"Sonno\" in Italian), so matching it breaks in every non-English locale.","example":"sleep","readOnly":true},"name":{"type":"string","description":"Display name, localized to the request language. Not stable — do not match on it."},"description":{"type":"string","description":"Hub description"},"thumbnailUrl":{"type":"string","description":"Hub thumbnail URL"},"orderIndex":{"type":"number","description":"Hub order index"},"language":{"type":"string","description":"Hub language"},"isEnabled":{"type":"boolean","description":"Whether the hub is enabled for this user"},"isAlwaysEnabled":{"type":"boolean","description":"Whether the hub is always enabled (like BuBu and Bookmarks)"},"hasNewUpdates":{"type":"boolean","description":"Whether the hub has new unseen updates"},"hopCategory":{"type":"string","enum":["BUBU_ANNOUNCEMENT","CHILD","PARTNER","PRODUCT"],"description":"Authoritative hop category. Unknown hubs safely use PRODUCT; clients must not infer this from the localized name."}},"required":["hubId","name","orderIndex","language","isEnabled","isAlwaysEnabled","hasNewUpdates","hopCategory"]},"ReorderUserHubsDto":{"type":"object","properties":{"hubIds":{"description":"Hub IDs in the desired order. Hubs omitted from the list retain their relative order after the submitted hubs.","example":["d2c675f2-323c-4533-a972-f5e6eae09529","fa7d2b1c-e6a4-45b9-9f0d-18c2e3b7d5a8"],"type":"array","items":{"type":"string"}}},"required":["hubIds"]},"ToggleUserHubDto":{"type":"object","properties":{"isEnabled":{"type":"boolean","description":"Whether to enable or disable the hub for the user","example":true}},"required":["isEnabled"]},"DropdownOptionDto":{"type":"object","properties":{"value":{"type":"string","description":"The value to be stored in backend","example":"MALE"},"label":{"type":"string","description":"The translated label shown to user","example":"Male"}},"required":["value","label"]},"LanguageOptionDto":{"type":"object","properties":{"code":{"type":"string","description":"ISO 639-1 language code","example":"en"},"name":{"type":"string","description":"The translated language name","example":"English"}},"required":["code","name"]},"ProfileDropdownOptionsDto":{"type":"object","properties":{"gender":{"description":"Gender options","type":"array","items":{"$ref":"#/components/schemas/DropdownOptionDto"}},"languagesSpoken":{"description":"Languages spoken at home options (ISO 639-1 codes)","type":"array","items":{"$ref":"#/components/schemas/LanguageOptionDto"}},"parentingMethods":{"description":"Parenting method options","type":"array","items":{"$ref":"#/components/schemas/DropdownOptionDto"}},"hobbies":{"description":"Hobby options","type":"array","items":{"$ref":"#/components/schemas/DropdownOptionDto"}},"parentingExperience":{"description":"Parenting experience options","type":"array","items":{"$ref":"#/components/schemas/DropdownOptionDto"}},"interestedTopics":{"description":"Interested topics for parenting options","type":"array","items":{"$ref":"#/components/schemas/DropdownOptionDto"}},"supportSystem":{"description":"Support system options","type":"array","items":{"$ref":"#/components/schemas/DropdownOptionDto"}},"religion":{"description":"Religion options","type":"array","items":{"$ref":"#/components/schemas/DropdownOptionDto"}},"livingEnvironment":{"description":"Living environment options","type":"array","items":{"$ref":"#/components/schemas/DropdownOptionDto"}},"hasPet":{"description":"Pet ownership options","type":"array","items":{"$ref":"#/components/schemas/DropdownOptionDto"}},"petTypes":{"description":"Pet type options","type":"array","items":{"$ref":"#/components/schemas/DropdownOptionDto"}}},"required":["gender","languagesSpoken","parentingMethods","hobbies","parentingExperience","interestedTopics","supportSystem","religion","livingEnvironment","hasPet","petTypes"]},"UpdateThirdPartyAiConsentDto":{"type":"object","properties":{"granted":{"type":"boolean","description":"True to accept sharing data with third party AI providers, false to decline or withdraw a previous acceptance.","example":true}},"required":["granted"]},"ThirdPartyAiConsentResponseDto":{"type":"object","properties":{"thirdPartyAiConsentGranted":{"type":"boolean","description":"The stored decision. null when the user has never been asked.","example":true},"thirdPartyAiConsentVersion":{"type":"string","description":"Version of the consent policy the decision was recorded against. Server owned.","example":"2026-08-31"},"thirdPartyAiConsentUpdatedAt":{"format":"date-time","type":"string","description":"When the decision was last recorded (server time).","example":"2026-08-31T09:14:22.000Z"},"thirdPartyAiConsentRequired":{"type":"boolean","description":"True when the consent screen must be shown: never asked, declined, withdrawn, or accepted against an older policy version.","readOnly":true,"example":false}},"required":["thirdPartyAiConsentRequired"]},"ChatRequestDto":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"ChatResponseWithInputTypeDto":{"type":"object","properties":{"type":{"type":"string","nullable":true},"data":{"type":"string","nullable":true},"date":{"type":"string","nullable":true},"placeholder":{"type":"string","nullable":true}},"required":["type","data","date","placeholder"]},"OnboardingChatResponseDto":{"type":"object","properties":{"id":{"type":"string"},"message":{"type":"string"},"nextQuestion":{"type":"string","nullable":true},"step":{"type":"number"},"totalSteps":{"type":"number"},"completed":{"type":"boolean"},"input":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/OnboardingInputDto"}]},"error":{"type":"string","nullable":true}},"required":["id","message","nextQuestion","step","totalSteps","completed","input","error"]},"OnboardingInputDto":{"type":"object","properties":{"type":{"type":"string","enum":["text","date","dropdown"]},"placeholder":{"type":"string"},"options":{"nullable":true,"type":"array","items":{"type":"string"}}},"required":["type","placeholder","options"]},"FlowSetsAnswerResponseDto":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"object"}},"required":["key","value"]},"FlowSecondaryActionResponseDto":{"type":"object","properties":{"label":{"type":"string"},"setsAnswer":{"description":"Answer to record when this button is tapped, if any","allOf":[{"$ref":"#/components/schemas/FlowSetsAnswerResponseDto"}]}},"required":["label"]},"FlowOptionResponseDto":{"type":"object","properties":{"value":{"type":"object"},"label":{"type":"string"}},"required":["value","label"]},"FlowConditionResponseDto":{"type":"object","properties":{"field":{"type":"string"},"op":{"type":"string","enum":["eq","neq","in","exists","notExists"]},"value":{"type":"object"}},"required":["field","op"]},"FlowStepResponseDto":{"type":"object","properties":{"id":{"type":"string"},"inputType":{"type":"string","enum":["info","text","date","single_choice"]},"message":{"type":"string","description":"Bubu's copy. May contain {{name}}, {{role}}, {{childName}}."},"saveAs":{"type":"string","description":"Answer key this step writes to"},"placeholder":{"type":"string"},"cta":{"type":"string"},"secondary":{"$ref":"#/components/schemas/FlowSecondaryActionResponseDto"},"options":{"type":"array","items":{"$ref":"#/components/schemas/FlowOptionResponseDto"}},"showIf":{"type":"array","items":{"$ref":"#/components/schemas/FlowConditionResponseDto"}}},"required":["id","inputType","message"]},"OnboardingFlowResponseDto":{"type":"object","properties":{"version":{"type":"string","description":"Config version (changes when steps change)"},"language":{"type":"string","description":"Language the copy was resolved to"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/FlowStepResponseDto"}}},"required":["version","language","steps"]},"SubmitOnboardingFlowDto":{"type":"object","properties":{"firstName":{"type":"string","example":"Ali"},"role":{"type":"string","enum":["mom","dad","step_mum","step_dad","grandma","grandpa","guardian"]},"birthDate":{"type":"string","description":"Birth date (past) or due date (future, for expecting parents). Optional — a parent may proceed without choosing a date. ISO 8601.","example":"2025-03-14"},"childBorn":{"type":"boolean","description":"Client-evaluated born flag used for branching. The server re-derives the source of truth from birthDate."},"childName":{"type":"string","description":"Child's name (may be skipped — \"decide later\")"},"gender":{"type":"string","enum":["female","male","unknown","other"]},"isPremature":{"type":"boolean","description":"Only meaningful when the child is born"},"isFirstChild":{"type":"boolean"},"painPoint":{"type":"string","description":"Optional free-text pain point if the parent typed instead of using the voice handoff."}},"required":["firstName","role"]},"VoiceHandoffDto":{"type":"object","properties":{"dynamicVariables":{"description":"The onboarding context. The client MUST pass these into the ElevenLabs SDK at conversation start (iOS: SessionConfig(dynamicVariables:)) — they are NOT carried by signedUrl.","allOf":[{"$ref":"#/components/schemas/OnboardingAgentVariablesDto"}]},"signedUrl":{"type":"string","nullable":true,"description":"ElevenLabs signed URL for the onboarding agent (use to start the conversation). The context is NOT carried here — pass dynamicVariables to the SDK separately. Null if the fetch failed (onboarding still completes)."},"agentId":{"type":"string","nullable":true,"description":"The onboarding agent id the signed URL was issued for."}},"required":["dynamicVariables"]},"SubmitOnboardingFlowResponseDto":{"type":"object","properties":{"completed":{"type":"boolean"},"babyId":{"type":"string"},"childBorn":{"type":"boolean","description":"Whether the child is treated as born (derived from birthDate)"},"voiceHandoff":{"$ref":"#/components/schemas/VoiceHandoffDto"}},"required":["completed","babyId","childBorn","voiceHandoff"]},"CreateEventDto":{"type":"object","properties":{}}}}}