{"openapi":"3.1.0","info":{"title":"HabitStats API","version":"0.1.0"},"paths":{"/api/health":{"get":{"tags":["meta"],"summary":"Health","operationId":"health","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}},"/api/stats/global":{"get":{"tags":["meta"],"summary":"Global Stats","operationId":"globalStats","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalStats"}}}}}}},"/api/auth/config":{"get":{"tags":["auth"],"summary":"Auth Config","operationId":"authConfig","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthConfig"}}}}}}},"/api/auth/signup":{"post":{"tags":["auth"],"summary":"Signup","operationId":"signup","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login":{"post":{"tags":["auth"],"summary":"Login","operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/demo":{"post":{"tags":["auth"],"summary":"Demo Login","description":"Log in to the shared read-only demo account (rebuilt daily so it runs up to today).","operationId":"demoLogin","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOut"}}}}}}},"/api/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","operationId":"logout","responses":{"204":{"description":"Successful Response"}}}},"/api/auth/logout-all":{"post":{"tags":["auth"],"summary":"Logout All","description":"Log out every browser session for this account (API tokens keep working).","operationId":"logoutAll","responses":{"204":{"description":"Successful Response"}}}},"/api/auth/verify":{"post":{"tags":["auth"],"summary":"Verify Email","operationId":"verifyEmail","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/resend-verification":{"post":{"tags":["auth"],"summary":"Resend Verification","operationId":"resendVerification","responses":{"204":{"description":"Successful Response"}}}},"/api/auth/forgot":{"post":{"tags":["auth"],"summary":"Forgot Password","description":"Always succeeds, so it can't be used to discover which emails have accounts.","operationId":"forgotPassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailIn"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/reset":{"post":{"tags":["auth"],"summary":"Reset Password","operationId":"resetPassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me":{"get":{"tags":["me"],"summary":"Get Me","operationId":"getMe","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOut"}}}}}},"patch":{"tags":["me"],"summary":"Update Me","operationId":"updateMe","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me/installed":{"post":{"tags":["me"],"summary":"Mark Installed","description":"The web app calls this when it runs as an installed app, so it stops offering to install.","operationId":"markInstalled","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstalledIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me/tokens":{"get":{"tags":["me"],"summary":"List Tokens","operationId":"listApiTokens","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApiTokenOut"},"type":"array","title":"Response Listapitokens"}}}}}},"post":{"tags":["me"],"summary":"Create Token","operationId":"createApiToken","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTokenCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me/tokens/{token_id}":{"delete":{"tags":["me"],"summary":"Revoke Token","operationId":"revokeApiToken","parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Token Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/habits":{"get":{"tags":["habits"],"summary":"List Habits","description":"Active habits in display order; `archived=true` lists the archived ones instead.","operationId":"listHabits","parameters":[{"name":"archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Archived"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HabitOut"},"title":"Response Listhabits"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["habits"],"summary":"Create Habit","operationId":"createHabit","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HabitIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HabitOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/habits/{habit_id}":{"get":{"tags":["habits"],"summary":"Read Habit","operationId":"getHabit","parameters":[{"name":"habit_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Habit Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HabitOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["habits"],"summary":"Update Habit","operationId":"updateHabit","parameters":[{"name":"habit_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Habit Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HabitUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HabitOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["habits"],"summary":"Delete Habit","description":"Permanently deletes the habit and all its entries. Archive it to keep the history.","operationId":"deleteHabit","parameters":[{"name":"habit_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Habit Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/habits/reorder":{"post":{"tags":["habits"],"summary":"Reorder Habits","description":"Set the display order of active habits. `ids` must list every active habit once.","operationId":"reorderHabits","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/HabitOut"},"type":"array","title":"Response Reorderhabits"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/habits/{habit_id}/options":{"post":{"tags":["habits"],"summary":"Create Option","operationId":"createOption","parameters":[{"name":"habit_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Habit Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HabitOptionIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HabitOptionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/options/{option_id}":{"patch":{"tags":["habits"],"summary":"Update Option","operationId":"updateOption","parameters":[{"name":"option_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Option Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HabitOptionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HabitOptionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["habits"],"summary":"Delete Option","operationId":"deleteOption","parameters":[{"name":"option_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Option Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/entries":{"get":{"tags":["entries"],"summary":"List Entries","description":"Entries between two local dates (inclusive), newest first.","operationId":"listEntries","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","title":"From"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date","title":"To"}},{"name":"habit_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Habit Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EntryOut"},"title":"Response Listentries"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/habits/{habit_id}/entries":{"post":{"tags":["entries"],"summary":"Create Entry","operationId":"createEntry","parameters":[{"name":"habit_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Habit Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/entries/{entry_id}":{"patch":{"tags":["entries"],"summary":"Update Entry","operationId":"updateEntry","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entry Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["entries"],"summary":"Delete Entry","operationId":"deleteEntry","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entry Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/habits/{habit_id}/timer/start":{"post":{"tags":["entries"],"summary":"Start Timer","description":"Start a timer. It keeps running on the server if the app is closed.","operationId":"startTimer","parameters":[{"name":"habit_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Habit Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimerStartIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/habits/{habit_id}/timer/stop":{"post":{"tags":["entries"],"summary":"Stop Timer","operationId":"stopTimer","parameters":[{"name":"habit_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Habit Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/habits/{habit_id}/timer/cancel":{"post":{"tags":["entries"],"summary":"Cancel Timer","description":"Throw away a running timer without logging it.","operationId":"cancelTimer","parameters":[{"name":"habit_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Habit Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bootstrap":{"get":{"tags":["bootstrap"],"summary":"Bootstrap","description":"Everything the app needs on open, in one request: the user, active habits, and\nentries for the last 400 days (plus tomorrow, for time zone slack).","operationId":"bootstrap","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bootstrap"}}}}}}},"/api/habits/{habit_id}/series":{"get":{"tags":["analytics"],"summary":"Habit Series","description":"Totals per period from `since` to `until` (default: today), empty periods as zero.\n`rolling=n` adds an n-period rolling average of complete periods. The period holding\ntoday is marked partial and compared with the same point in the previous period.","operationId":"habitSeries","parameters":[{"name":"habit_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Habit Id"}},{"name":"period","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Period","default":"week"}},{"name":"metric","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Metric"},{"type":"null"}],"title":"Metric"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Since"}},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Until"}},{"name":"rolling","in":"query","required":false,"schema":{"type":"integer","maximum":52,"minimum":0,"default":0,"title":"Rolling"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Series"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/habits/{habit_id}/breakdown":{"get":{"tags":["analytics"],"summary":"Habit Breakdown","description":"Totals split by weekday (1 = Monday), hour of day (from the start time of timer\nentries, otherwise when the entry was logged) or option, in the user's time zone.","operationId":"habitBreakdown","parameters":[{"name":"habit_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Habit Id"}},{"name":"by","in":"query","required":true,"schema":{"enum":["weekday","hour","option"],"type":"string","title":"By"}},{"name":"metric","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Metric"},{"type":"null"}],"title":"Metric"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Since"}},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Until"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BreakdownItem"},"title":"Response Habitbreakdown"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/habits/{habit_id}/summary":{"get":{"tags":["analytics"],"summary":"Habit Summary","description":"Streaks, entry and day counts, the total and per-day average, and the option split,\nover `since`..`until` (all time by default).","operationId":"habitSummary","parameters":[{"name":"habit_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Habit Id"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Since"}},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Until"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HabitSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/feedback":{"post":{"tags":["feedback"],"summary":"Create Feedback","description":"Store feedback and email it to the address in FEEDBACK_EMAIL, if set.","operationId":"createFeedback","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ApiTokenCreated":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"token":{"type":"string","title":"Token","description":"Shown once. Send as `Authorization: Bearer <token>`."}},"type":"object","required":["id","name","created_at","last_used_at","token"],"title":"ApiTokenCreated"},"ApiTokenIn":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"ApiTokenIn"},"ApiTokenOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"}},"type":"object","required":["id","name","created_at","last_used_at"],"title":"ApiTokenOut"},"AuthConfig":{"properties":{"google":{"type":"boolean","title":"Google"}},"type":"object","required":["google"],"title":"AuthConfig"},"Bootstrap":{"properties":{"me":{"$ref":"#/components/schemas/MeOut"},"today":{"type":"string","format":"date","title":"Today","description":"Today in the user's time zone."},"from_date":{"type":"string","format":"date","title":"From Date","description":"Entries are included from this date on."},"habits":{"items":{"$ref":"#/components/schemas/HabitOut"},"type":"array","title":"Habits"},"entries":{"items":{"$ref":"#/components/schemas/EntryOut"},"type":"array","title":"Entries"}},"type":"object","required":["me","today","from_date","habits","entries"],"title":"Bootstrap"},"BreakdownItem":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"value":{"type":"number","title":"Value"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"}},"type":"object","required":["key","label","value"],"title":"BreakdownItem"},"CurrentPeriod":{"properties":{"start":{"type":"string","format":"date","title":"Start"},"end":{"type":"string","format":"date","title":"End"},"elapsed_days":{"type":"integer","title":"Elapsed Days"},"total_days":{"type":"integer","title":"Total Days"},"value":{"type":"number","title":"Value"},"previous_same_point":{"type":"number","title":"Previous Same Point","description":"The previous period's value over the same number of days."},"previous_total":{"type":"number","title":"Previous Total"},"projected":{"type":"number","title":"Projected","description":"Value at the current pace by the end of the period."}},"type":"object","required":["start","end","elapsed_days","total_days","value","previous_same_point","previous_total","projected"],"title":"CurrentPeriod"},"EmailIn":{"properties":{"email":{"type":"string","maxLength":320,"format":"email","title":"Email"}},"type":"object","required":["email"],"title":"EmailIn"},"EntryIn":{"properties":{"local_date":{"type":"string","format":"date","title":"Local Date"},"value":{"anyOf":[{"type":"number","maximum":9999999999.0,"minimum":-9999999999.0},{"type":"null"}],"title":"Value"},"option_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Option Id"},"duration_s":{"anyOf":[{"type":"integer","maximum":604800.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Duration S"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"note":{"type":"string","maxLength":5000,"title":"Note","default":""}},"type":"object","required":["local_date"],"title":"EntryIn","description":"What's required depends on the habit type:\ncheckbox: nothing; number: value; options: option_id; timer: duration_s."},"EntryOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"habit_id":{"type":"string","format":"uuid","title":"Habit Id"},"local_date":{"type":"string","format":"date","title":"Local Date"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"duration_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration S"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"option_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Option Id"},"note":{"type":"string","title":"Note"},"source":{"$ref":"#/components/schemas/EntrySource"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","habit_id","local_date","started_at","ended_at","duration_s","value","option_id","note","source","created_at"],"title":"EntryOut"},"EntrySource":{"type":"string","enum":["web","api","import"],"title":"EntrySource"},"EntryUpdate":{"properties":{"local_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Local Date"},"value":{"anyOf":[{"type":"number","maximum":9999999999.0,"minimum":-9999999999.0},{"type":"null"}],"title":"Value"},"option_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Option Id"},"duration_s":{"anyOf":[{"type":"integer","maximum":604800.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Duration S"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"note":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Note"}},"type":"object","title":"EntryUpdate"},"FeedbackIn":{"properties":{"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message"}},"type":"object","required":["message"],"title":"FeedbackIn"},"FeedbackOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","created_at"],"title":"FeedbackOut"},"GlobalStats":{"properties":{"entries_logged":{"type":"integer","title":"Entries Logged"}},"type":"object","required":["entries_logged"],"title":"GlobalStats"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HabitIn":{"properties":{"title":{"type":"string","maxLength":100,"minLength":1,"title":"Title"},"description":{"type":"string","maxLength":2000,"title":"Description","default":""},"type":{"$ref":"#/components/schemas/HabitType"},"unit":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Unit"},"target":{"anyOf":[{"type":"number","maximum":9999999999.0,"minimum":0.0},{"type":"null"}],"title":"Target"},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","title":"Color","default":"#2a78d6"},"options":{"items":{"$ref":"#/components/schemas/HabitOptionIn"},"type":"array","maxItems":20,"title":"Options","default":[]}},"type":"object","required":["title","type"],"title":"HabitIn"},"HabitOptionIn":{"properties":{"label":{"type":"string","maxLength":100,"minLength":1,"title":"Label"},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","title":"Color","default":"#2a78d6"}},"type":"object","required":["label"],"title":"HabitOptionIn"},"HabitOptionOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"label":{"type":"string","title":"Label"},"color":{"type":"string","title":"Color"},"sort":{"type":"integer","title":"Sort"}},"type":"object","required":["id","label","color","sort"],"title":"HabitOptionOut"},"HabitOptionUpdate":{"properties":{"label":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Label"},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}],"title":"Color"},"sort":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sort"}},"type":"object","title":"HabitOptionUpdate"},"HabitOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"type":{"$ref":"#/components/schemas/HabitType"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"target":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Target"},"color":{"type":"string","title":"Color"},"sort":{"type":"integer","title":"Sort"},"archived":{"type":"boolean","title":"Archived"},"options":{"items":{"$ref":"#/components/schemas/HabitOptionOut"},"type":"array","title":"Options"},"entry_count":{"type":"integer","title":"Entry Count"},"running_timer":{"anyOf":[{"$ref":"#/components/schemas/EntryOut"},{"type":"null"}],"description":"The timer entry currently running for this habit, if any."}},"type":"object","required":["id","title","description","type","unit","target","color","sort","archived","options","entry_count","running_timer"],"title":"HabitOut"},"HabitSummary":{"properties":{"since":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Since"},"until":{"type":"string","format":"date","title":"Until"},"current_streak":{"type":"integer","title":"Current Streak","description":"Days in a row with an entry, ending today (or yesterday if today has none yet). Ignores the range."},"longest_streak":{"type":"integer","title":"Longest Streak","description":"Longest run of days in a row within the range."},"entries":{"type":"integer","title":"Entries"},"days":{"type":"integer","title":"Days","description":"Distinct days with an entry."},"metric":{"type":"string","title":"Metric","description":"What `total` measures: the habit type's default metric."},"total":{"type":"number","title":"Total"},"average":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average","description":"Per day with an entry (total / days, as HabitHeat shows it), for timer (seconds) and number habits; else null."},"by_option":{"anyOf":[{"items":{"$ref":"#/components/schemas/BreakdownItem"},"type":"array"},{"type":"null"}],"title":"By Option","description":"Option habits: entries per option (value = count)."}},"type":"object","required":["since","until","current_streak","longest_streak","entries","days","metric","total","average","by_option"],"title":"HabitSummary","description":"Headline numbers for a habit over a range (all time when `since` is null)."},"HabitType":{"type":"string","enum":["checkbox","number","options","timer"],"title":"HabitType"},"HabitUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"unit":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Unit"},"target":{"anyOf":[{"type":"number","maximum":9999999999.0,"minimum":0.0},{"type":"null"}],"title":"Target"},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}],"title":"Color"},"archived":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Archived"}},"type":"object","title":"HabitUpdate","description":"The habit type can't change once entries exist, so it isn't editable."},"Health":{"properties":{"status":{"type":"string","title":"Status"},"database":{"type":"boolean","title":"Database"},"version":{"type":"string","title":"Version"}},"type":"object","required":["status","database","version"],"title":"Health"},"InstallPlatform":{"type":"string","enum":["ios","android","desktop"],"title":"InstallPlatform","description":"Where someone has put the app on their home screen or desktop."},"InstalledIn":{"properties":{"platform":{"$ref":"#/components/schemas/InstallPlatform"}},"type":"object","required":["platform"],"title":"InstalledIn"},"LoginIn":{"properties":{"email":{"type":"string","maxLength":320,"format":"email","title":"Email"},"password":{"type":"string","maxLength":256,"title":"Password"}},"type":"object","required":["email","password"],"title":"LoginIn"},"MeOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"email_verified":{"type":"boolean","title":"Email Verified"},"display_name":{"type":"string","title":"Display Name"},"timezone":{"type":"string","title":"Timezone"},"week_start":{"type":"integer","title":"Week Start"},"has_password":{"type":"boolean","title":"Has Password"},"google_linked":{"type":"boolean","title":"Google Linked"},"installed_on":{"items":{"$ref":"#/components/schemas/InstallPlatform"},"type":"array","title":"Installed On"},"install_dismissed":{"type":"boolean","title":"Install Dismissed"},"is_demo":{"type":"boolean","title":"Is Demo","description":"The shared read-only demo account."}},"type":"object","required":["id","email","email_verified","display_name","timezone","week_start","has_password","google_linked","installed_on","install_dismissed","is_demo"],"title":"MeOut"},"MeUpdate":{"properties":{"display_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Display Name"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"week_start":{"anyOf":[{"type":"integer","maximum":7.0,"minimum":1.0},{"type":"null"}],"title":"Week Start"},"install_dismissed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Install Dismissed"}},"type":"object","title":"MeUpdate"},"Metric":{"type":"string","enum":["count","days","duration","value"],"title":"Metric"},"Period":{"type":"string","enum":["day","week","month","quarter","year"],"title":"Period"},"ReorderIn":{"properties":{"ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":500,"title":"Ids"}},"type":"object","required":["ids"],"title":"ReorderIn"},"ResetIn":{"properties":{"token":{"type":"string","maxLength":200,"title":"Token"},"password":{"type":"string","maxLength":256,"minLength":8,"title":"Password"}},"type":"object","required":["token","password"],"title":"ResetIn"},"Series":{"properties":{"habit_id":{"type":"string","format":"uuid","title":"Habit Id"},"period":{"type":"string","title":"Period"},"metric":{"type":"string","title":"Metric"},"rolling":{"type":"integer","title":"Rolling"},"today":{"type":"string","format":"date","title":"Today"},"points":{"items":{"$ref":"#/components/schemas/SeriesPoint"},"type":"array","title":"Points"},"current":{"anyOf":[{"$ref":"#/components/schemas/CurrentPeriod"},{"type":"null"}]},"total":{"type":"number","title":"Total","description":"Total over the whole range."}},"type":"object","required":["habit_id","period","metric","rolling","today","points","current","total"],"title":"Series"},"SeriesPoint":{"properties":{"start":{"type":"string","format":"date","title":"Start"},"end":{"type":"string","format":"date","title":"End"},"value":{"type":"number","title":"Value"},"partial":{"type":"boolean","title":"Partial","description":"The period isn't over yet (it contains today)."},"rolling":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rolling","description":"Rolling average of complete periods, if asked."},"by_option":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"By Option","description":"Option habits: the value split by option id."}},"type":"object","required":["start","end","value","partial","rolling"],"title":"SeriesPoint"},"SignupIn":{"properties":{"email":{"type":"string","maxLength":320,"format":"email","title":"Email"},"password":{"type":"string","maxLength":256,"minLength":8,"title":"Password"},"display_name":{"type":"string","maxLength":100,"title":"Display Name","default":""},"timezone":{"type":"string","title":"Timezone","default":"UTC"}},"type":"object","required":["email","password"],"title":"SignupIn"},"TimerStartIn":{"properties":{"note":{"type":"string","maxLength":5000,"title":"Note","default":""}},"type":"object","title":"TimerStartIn"},"TokenIn":{"properties":{"token":{"type":"string","maxLength":200,"title":"Token"}},"type":"object","required":["token"],"title":"TokenIn"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}