{"version":"1.2.0","openapi":"3.1.0","info":{"title":"Facets API","version":"1.2.0"},"description":"Prism API","servers":[{"url":"https://facets-beta.johncorni.sh","description":"Current server"}],"paths":{"/":{"get":{"summary":"Get OpenAPI specification for this API. Periodically request this definition again because the API will evolve on a regular basis.","operationId":"getRoot","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAPISchema"}}}}}}},"/ai":{"post":{"summary":"Ask AI (proxy to AI API)","operationId":"postAi","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIWebResponse"}}}}}}},"/ai/conversation":{"post":{"summary":"Multi-message AI conversation","operationId":"postAiConversation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}}}}}}},"/ai/transcribe":{"post":{"summary":"Transcribe audio (Whisper integration)","operationId":"postAiTranscribe","requestBody":{"required":true,"content":{"application/json":{"schema":{}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscribeResponse"}}}}}}},"/auth/api-keys":{"post":{"summary":"Create a new API key for the authenticated user","operationId":"postAuthApi-keys","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAPIKeyRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAPIKeyResponse"}}}}}}},"/auth/magic-link":{"post":{"summary":"Request a magic link for authentication","operationId":"postAuthMagic-link","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkResponse"}}}}}}},"/auth/verify":{"get":{"summary":"Verify a magic link token","operationId":"getAuthVerify","responses":{"200":{"description":"Successful response"}}}},"/health":{"get":{"summary":"Health check endpoint for CI/monitoring","operationId":"getHealth","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}}}}},"/is-authenticated":{"get":{"summary":"Check if the user is authenticated","operationId":"getIs-authenticated","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IsAuthenticatedResponse"}}}}}}},"/metrics":{"get":{"summary":"List all metrics with value since start_date","operationId":"getMetrics","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string"},"description":"Start date (RFC3339 with timezone) for value aggregation"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MetricWithValueResponse"}}}}}}},"post":{"summary":"Create a new metric","operationId":"postMetrics","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricResponse"}}}}}},"put":{"summary":"Update an existing metric","operationId":"putMetrics","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricUpdateInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricResponse"}}}}}}},"/metrics/batch-count":{"post":{"summary":"Log a batch of metric counts","operationId":"postMetricsBatch-count","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MetricCountInput"}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MetricCountResponse"}}}}}}}},"/metrics/count":{"get":{"summary":"Get metric counts within a date range","operationId":"getMetricsCount","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string"},"description":"Start date of range"},{"name":"end_date","in":"query","required":false,"schema":{"type":"string"},"description":"End date of range"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MetricCountResponse"}}}}}}},"post":{"summary":"Log a metric count","operationId":"postMetricsCount","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricCountInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricCountResponse"}}}}}}},"/metrics/flush-and-switch-session":{"post":{"summary":"Flush current session and start a new session for a section/category","operationId":"postMetricsFlush-and-switch-session","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSessionConfig"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSessionResponse"}}}}}}},"/metrics/import":{"post":{"summary":"Import metrics and category layout","operationId":"postMetricsImport","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsImportInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsImportResponse"}}}}}}},"/metrics/session":{"get":{"summary":"Get the current metrics session for the user","operationId":"getMetricsSession","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSessionResponse"}}}}}},"put":{"summary":"Update the current metrics session counts","operationId":"putMetricsSession","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSessionConfig"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSessionResponse"}}}}}}},"/metrics/session/discard":{"post":{"summary":"Discard the current session without logging","operationId":"postMetricsSessionDiscard","requestBody":{"required":true,"content":{"application/json":{"schema":{}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSessionResponse"}}}}}}},"/metrics/session/flush":{"post":{"summary":"Flush session counts and keep session open","operationId":"postMetricsSessionFlush","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSessionConfig"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSessionResponse"}}}}}}},"/metrics/session/flush-and-close":{"post":{"summary":"Flush session counts and close session","operationId":"postMetricsSessionFlush-and-close","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSessionConfig"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSessionResponse"}}}}}}},"/metrics/session/start":{"post":{"summary":"Start a metrics session for a section/category","operationId":"postMetricsSessionStart","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSessionConfig"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSessionResponse"}}}}}}},"/metrics/time":{"get":{"summary":"Get all active timer sessions for a user, optionally filtering by a single metric_id","operationId":"getMetricsTime","parameters":[{"name":"metric_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Metric ID"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TimerSessionResponse"}}}}}}},"post":{"summary":"Start a new timer session for a metric","operationId":"postMetricsTime","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimerSessionInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimerSessionResponse"}}}}}},"put":{"summary":"Stop an active timer session","operationId":"putMetricsTime","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopTimerSessionInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimerSessionResponse"}}}}}}},"/monitors":{"get":{"summary":"List or get monitors","operationId":"getMonitors","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"integer"},"description":"Monitor ID (optional)"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MonitorResponse"}}}}}}},"post":{"summary":"Create a new monitor","operationId":"postMonitors","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorResponse"}}}}}},"put":{"summary":"Update a monitor","operationId":"putMonitors","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorUpdateInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorResponse"}}}}}},"delete":{"summary":"Delete a monitor","operationId":"deleteMonitors","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorResponse"}}}}}}},"/monitors/pin":{"put":{"summary":"Pin a monitor","operationId":"putMonitorsPin","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorPinInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorResponse"}}}}}},"delete":{"summary":"Unpin a monitor","operationId":"deleteMonitorsPin","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorResponse"}}}}}}},"/monitors/scores":{"get":{"summary":"Get monitor scores","operationId":"getMonitorsScores","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"integer"},"description":"Monitor ID (optional)"},{"name":"current_time","in":"query","required":false,"schema":{"type":"string"},"description":"Anchor day for scoring (RFC3339, optional)"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MonitorScoreResponse"}}}}}}}},"/people":{"get":{"summary":"Either get a list of people or return a list of one person by id","operationId":"getPeople","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"integer"},"description":"The id of the person"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PersonResponse"}}}}}}},"post":{"summary":"Create a new person","operationId":"postPeople","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonResponse"}}}}}},"put":{"summary":"Update a person","operationId":"putPeople","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonUpdateRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonResponse"}}}}}},"delete":{"summary":"Delete a person","operationId":"deletePeople","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonResponse"}}}}}}},"/ratios":{"get":{"summary":"List or get ratios","operationId":"getRatios","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"integer"},"description":"Ratio ID (optional)"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RatioResponse"}}}}}}},"post":{"summary":"Create a new ratio","operationId":"postRatios","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatioInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatioResponse"}}}}}},"put":{"summary":"Update a ratio","operationId":"putRatios","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatioUpdateRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatioResponse"}}}}}},"delete":{"summary":"Delete a ratio","operationId":"deleteRatios","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatioResponse"}}}}}}},"/ratios/nodes":{"get":{"summary":"Get ratio nodes for a monitor","operationId":"getRatiosNodes","parameters":[{"name":"from_monitor_id","in":"query","required":true,"schema":{"type":"integer"},"description":"Source monitor ID"},{"name":"current_time","in":"query","required":true,"schema":{"type":"string"},"description":"Current time (RFC3339 with offset)"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatioNodesResponse"}}}}}}},"/ratios/upsert":{"put":{"summary":"Upsert forward ratios for a monitor","operationId":"putRatiosUpsert","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatioUpsertRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RatioResponse"}}}}}}}},"/stream/entries":{"get":{"summary":"List stream entries, optionally filtered by day","operationId":"getStreamEntries","parameters":[{"name":"day","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by day (format: YYYY-MM-DD or 'today'). Includes entries from that day plus all pinned entries."},{"name":"tz_offset","in":"query","required":false,"schema":{"type":"integer"},"description":"Client timezone offset in minutes (JS getTimezoneOffset()). UTC-5 = 300, UTC+5 = -300."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StreamEntryResponse"}}}}}}},"post":{"summary":"Create a new stream entry","operationId":"postStreamEntries","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StreamEntryInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StreamEntryResponse"}}}}}}},"/stream/entries/pin":{"put":{"summary":"Pin a stream entry","operationId":"putStreamEntriesPin","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StreamEntryPinInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StreamEntryResponse"}}}}}},"delete":{"summary":"Unpin a stream entry","operationId":"deleteStreamEntriesPin","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StreamEntryResponse"}}}}}}},"/thoughts":{"get":{"summary":"List thoughts for a given date or date range","operationId":"getThoughts","parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by date (format: YYYY-MM-DD or 'today')"},{"name":"tz_offset","in":"query","required":false,"schema":{"type":"integer"},"description":"Timezone offset in minutes (value of getTimezoneOffset())"},{"name":"start_date","in":"query","required":false,"schema":{"type":"string"},"description":"Start of date range (RFC3339). When provided with end_date, returns all thoughts with a metric_id in range."},{"name":"end_date","in":"query","required":false,"schema":{"type":"string"},"description":"End of date range (RFC3339). Used together with start_date."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ThoughtResponse"}}}}}}},"post":{"summary":"Create a new thought","operationId":"postThoughts","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThoughtInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThoughtResponse"}}}}}},"put":{"summary":"Update a thought","operationId":"putThoughts","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThoughtUpdateInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThoughtResponse"}}}}}},"delete":{"summary":"Delete a thought","operationId":"deleteThoughts","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/thoughts/calendar":{"get":{"summary":"Get dates that have thoughts for a given month","operationId":"getThoughtsCalendar","parameters":[{"name":"month","in":"query","required":true,"schema":{"type":"string"},"description":"Month in YYYY-MM format"},{"name":"tz_offset","in":"query","required":false,"schema":{"type":"integer"},"description":"Timezone offset in minutes (value of getTimezoneOffset())"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/calendarResponse"}}}}}}},"/thoughts/links":{"get":{"summary":"Get thoughts linked to a given thought","operationId":"getThoughtsLinks","parameters":[{"name":"thought_id","in":"query","required":true,"schema":{"type":"integer"},"description":"ID of the thought to get links for"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ThoughtResponse"}}}}}}},"post":{"summary":"Link two thoughts together","operationId":"postThoughtsLinks","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThoughtLinkInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}}}},"delete":{"summary":"Unlink two thoughts","operationId":"deleteThoughtsLinks","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/user/settings":{"get":{"summary":"Get user settings","operationId":"getUserSettings","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}}}},"post":{"summary":"Save user settings","operationId":"postUserSettings","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}}}}}},"components":{"schemas":{"AIRequest":{"type":"object","properties":{"includeData":{"type":"boolean"},"prompt":{"type":"string"}},"required":["prompt","includeData"]},"AIWebResponse":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]},"BackwardRatioNode":{"type":"object","properties":{"from_monitor_id":{"type":"integer"},"from_monitor_name":{"type":"string"},"ratio_id":{"type":"integer"},"values":{"type":"array","items":{"type":"number","format":"double"}}},"required":["ratio_id","from_monitor_id","from_monitor_name","values"]},"Category":{"type":"object","properties":{"id":{"type":"string"},"metricIds":{"type":"array","items":{"type":"integer"}},"name":{"type":"string"}},"required":["id","name","metricIds"]},"Components":{"type":"object","properties":{"schemas":{"type":"object","additionalProperties":{}}},"required":["schemas"]},"CreateAPIKeyRequest":{"type":"object","properties":{"expire_days":{"type":"integer"},"name":{"type":"string"}},"required":["name","expire_days"]},"CreateAPIKeyResponse":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]},"ForwardRatioNode":{"type":"object","properties":{"ratio_id":{"type":"integer"},"to_monitor_id":{"type":"integer"},"to_monitor_name":{"type":"string"},"values":{"type":"array","items":{"type":"number","format":"double"}}},"required":["ratio_id","to_monitor_id","to_monitor_name","values"]},"Info":{"type":"object","properties":{"title":{"type":"string"},"version":{"type":"string"}},"required":["title","version"]},"IsAuthenticatedResponse":{"type":"object"},"Location":{"type":"object"},"MagicLinkRequest":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"]},"MagicLinkResponse":{"type":"object","properties":{"token":{"type":"string"}}},"Message":{"type":"object","properties":{"content":{"type":"string"},"from":{"type":"string","enum":["robot","user"]}},"required":["from","content"]},"MetricCount":{"type":"object","properties":{"metric_id":{"type":"integer"},"value":{"type":"integer"}},"required":["metric_id","value"]},"MetricCountInput":{"type":"object","properties":{"metric_id":{"type":"integer"},"timestamp":{"type":"string"},"value":{"type":"integer"}},"required":["metric_id"]},"MetricCountResponse":{"type":"object","properties":{"id":{"type":"integer"},"metric_id":{"type":"integer"},"timestamp":{"type":"string"},"value":{"type":"integer"}},"required":["id","metric_id","value","timestamp"]},"MetricInput":{"type":"object","properties":{"daily_goal":{"type":"integer"},"description":{"type":"string"},"hide":{"type":"boolean"},"is_timer":{"type":"boolean"},"name":{"type":"string"}},"required":["name","is_timer","description","hide"]},"MetricResponse":{"type":"object","properties":{"created_at":{"type":"string"},"daily_goal":{"type":"integer"},"description":{"type":"string"},"hide":{"type":"boolean"},"id":{"type":"integer"},"is_timer":{"type":"boolean"},"name":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","created_at","updated_at","is_timer","description","hide"]},"MetricUpdateInput":{"type":"object","properties":{"daily_goal":{"type":"integer"},"description":{"type":"string"},"hide":{"type":"boolean"},"id":{"type":"integer"},"is_timer":{"type":"boolean"},"name":{"type":"string"}},"required":["id","name","is_timer","description","hide"]},"MetricWithValueResponse":{"type":"object","properties":{"created_at":{"type":"string"},"daily_goal":{"type":"integer"},"description":{"type":"string"},"hide":{"type":"boolean"},"id":{"type":"integer"},"is_timer":{"type":"boolean"},"name":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"integer"}},"required":["id","name","created_at","updated_at","is_timer","description","hide","value"]},"MetricsImportEntry":{"type":"object","properties":{"daily_goal":{"type":"integer"},"description":{"type":"string"},"hide":{"type":"boolean"},"id":{"type":"integer"},"is_timer":{"type":"boolean"},"name":{"type":"string"}},"required":["id","name","is_timer","description","hide"]},"MetricsImportInput":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"metricIds":{"type":"array","items":{"type":"integer"}},"name":{"type":"string"}},"required":["id","name","metricIds"]}},"metrics":{"type":"array","items":{"type":"object","properties":{"daily_goal":{"type":"integer"},"description":{"type":"string"},"hide":{"type":"boolean"},"id":{"type":"integer"},"is_timer":{"type":"boolean"},"name":{"type":"string"}},"required":["id","name","is_timer","description","hide"]}}},"required":["categories","metrics"]},"MetricsImportResponse":{"type":"object","properties":{"metrics":{"type":"array","items":{"type":"object","properties":{"created_at":{"type":"string"},"daily_goal":{"type":"integer"},"description":{"type":"string"},"hide":{"type":"boolean"},"id":{"type":"integer"},"is_timer":{"type":"boolean"},"name":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","created_at","updated_at","is_timer","description","hide"]}},"settings":{"type":"object","properties":{"id":{"type":"integer"},"metrics_layout":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"metricIds":{"type":"array","items":{"type":"integer"}},"name":{"type":"string"}},"required":["id","name","metricIds"]}},"uncategorizedOrder":{"type":"array","items":{"type":"integer"}}},"required":["categories","uncategorizedOrder"]},"user_id":{"type":"integer"}},"required":["id","user_id","metrics_layout"]}},"required":["metrics","settings"]},"MetricsLayout":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"metricIds":{"type":"array","items":{"type":"integer"}},"name":{"type":"string"}},"required":["id","name","metricIds"]}},"uncategorizedOrder":{"type":"array","items":{"type":"integer"}}},"required":["categories","uncategorizedOrder"]},"MetricsSessionConfig":{"type":"object","properties":{"metric_counts":{"type":"array","items":{"type":"object","properties":{"metric_id":{"type":"integer"},"value":{"type":"integer"}},"required":["metric_id","value"]}},"section_name":{"type":"string"}},"required":["section_name","metric_counts"]},"MetricsSessionResponse":{"type":"object","properties":{"config":{"type":"object","properties":{"metric_counts":{"type":"array","items":{"type":"object","properties":{"metric_id":{"type":"integer"},"value":{"type":"integer"}},"required":["metric_id","value"]}},"section_name":{"type":"string"}},"required":["section_name","metric_counts"]},"is_active":{"type":"boolean"}},"required":["is_active","config"]},"MonitorDeleteInput":{"type":"object","properties":{"id":{"type":"integer"}},"required":["id"]},"MonitorInput":{"type":"object","properties":{"day_range":{"type":"integer"},"days_above":{"type":"number","format":"double"},"days_below":{"type":"number","format":"double"},"metrics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"max":{"type":"integer"},"min":{"type":"integer"},"weight":{"type":"number","format":"double"}},"required":["id","weight","min","max"]}},"name":{"type":"string"},"pinned":{"type":"boolean"}},"required":["name","pinned","metrics"]},"MonitorMetric":{"type":"object","properties":{"id":{"type":"integer"},"max":{"type":"integer"},"min":{"type":"integer"},"weight":{"type":"number","format":"double"}},"required":["id","weight","min","max"]},"MonitorPinInput":{"type":"object","properties":{"id":{"type":"integer"}},"required":["id"]},"MonitorQuery":{"type":"object","properties":{"current_time":{"type":"string"},"id":{"type":"integer"}},"required":["id","current_time"]},"MonitorResponse":{"type":"object","properties":{"day_range":{"type":"integer"},"days_above":{"type":"number","format":"double"},"days_below":{"type":"number","format":"double"},"id":{"type":"integer"},"metrics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"max":{"type":"integer"},"min":{"type":"integer"},"weight":{"type":"number","format":"double"}},"required":["id","weight","min","max"]}},"name":{"type":"string"},"pinned":{"type":"boolean"}},"required":["id","name","pinned","metrics"]},"MonitorScoreResponse":{"type":"object","properties":{"average":{"type":"number","format":"double"},"config":{"type":"object","properties":{"day_range":{"type":"integer"},"days_above":{"type":"number","format":"double"},"days_below":{"type":"number","format":"double"},"metrics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"max":{"type":"integer"},"min":{"type":"integer"},"weight":{"type":"number","format":"double"}},"required":["id","weight","min","max"]}},"name":{"type":"string"},"pinned":{"type":"boolean"}},"required":["pinned","metrics"]},"day_range":{"type":"number","format":"double"},"days_above":{"type":"number","format":"double"},"days_below":{"type":"number","format":"double"},"monitor_id":{"type":"integer"},"previous_averages":{"type":"array","items":{"type":"number","format":"double"}},"total_score":{"type":"number","format":"double"},"trend":{"type":"string","enum":["up","down","stay"]}},"required":["monitor_id","total_score","config"]},"MonitorUpdateInput":{"type":"object","properties":{"day_range":{"type":"integer"},"days_above":{"type":"number","format":"double"},"days_below":{"type":"number","format":"double"},"id":{"type":"integer"},"metrics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"max":{"type":"integer"},"min":{"type":"integer"},"weight":{"type":"number","format":"double"}},"required":["id","weight","min","max"]}},"name":{"type":"string"},"pinned":{"type":"boolean"}},"required":["id","name","pinned","metrics"]},"OpenAPISchema":{"type":"object","properties":{"components":{"type":"object","properties":{"schemas":{"type":"object","additionalProperties":{}}},"required":["schemas"]},"description":{"type":"string"},"info":{"type":"object","properties":{"title":{"type":"string"},"version":{"type":"string"}},"required":["title","version"]},"openapi":{"type":"string"},"paths":{"type":"object","additionalProperties":{}},"servers":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"url":{"type":"string"}},"required":["url"]}},"version":{"type":"string"}},"required":["version","openapi","info","description","servers","paths","components"]},"PeopleQuery":{"type":"object","properties":{"id":{"type":"integer"}},"required":["id"]},"PersonDeleteRequest":{"type":"object","properties":{"id":{"type":"integer"}},"required":["id"]},"PersonInput":{"type":"object","properties":{"name":{"type":"string"},"nickname":{"type":"string"}},"required":["name"]},"PersonResponse":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"nickname":{"type":"string"}},"required":["id","name"]},"PersonUpdateRequest":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"nickname":{"type":"string"}},"required":["id","name"]},"RatioDeleteRequest":{"type":"object","properties":{"id":{"type":"integer"}},"required":["id"]},"RatioInput":{"type":"object","properties":{"from_monitor_id":{"type":"integer"},"to_monitor_id":{"type":"integer"}},"required":["from_monitor_id","to_monitor_id"]},"RatioNodesInput":{"type":"object","properties":{"current_time":{"type":"string"},"from_monitor_id":{"type":"integer"}},"required":["from_monitor_id","current_time"]},"RatioNodesResponse":{"type":"object","properties":{"backward_ratios":{"type":"array","items":{"type":"object","properties":{"from_monitor_id":{"type":"integer"},"from_monitor_name":{"type":"string"},"ratio_id":{"type":"integer"},"values":{"type":"array","items":{"type":"number","format":"double"}}},"required":["ratio_id","from_monitor_id","from_monitor_name","values"]}},"forward_ratios":{"type":"array","items":{"type":"object","properties":{"ratio_id":{"type":"integer"},"to_monitor_id":{"type":"integer"},"to_monitor_name":{"type":"string"},"values":{"type":"array","items":{"type":"number","format":"double"}}},"required":["ratio_id","to_monitor_id","to_monitor_name","values"]}},"from_monitor_id":{"type":"integer"}},"required":["from_monitor_id","forward_ratios","backward_ratios"]},"RatioResponse":{"type":"object","properties":{"from_monitor_id":{"type":"integer"},"id":{"type":"integer"},"to_monitor_id":{"type":"integer"}},"required":["id","from_monitor_id","to_monitor_id"]},"RatioUpdateRequest":{"type":"object","properties":{"from_monitor_id":{"type":"integer"},"id":{"type":"integer"},"to_monitor_id":{"type":"integer"}},"required":["id","from_monitor_id","to_monitor_id"]},"RatioUpsertRequest":{"type":"object","properties":{"from_monitor_id":{"type":"integer"},"to_monitor_ids":{"type":"array","items":{"type":"integer"}}},"required":["from_monitor_id","to_monitor_ids"]},"RatiosQuery":{"type":"object","properties":{"id":{"type":"integer"}},"required":["id"]},"ServerUrl":{"type":"object","properties":{"description":{"type":"string"},"url":{"type":"string"}},"required":["url"]},"SettingsInput":{"type":"object","properties":{"metrics_layout":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"metricIds":{"type":"array","items":{"type":"integer"}},"name":{"type":"string"}},"required":["id","name","metricIds"]}},"uncategorizedOrder":{"type":"array","items":{"type":"integer"}}},"required":["categories","uncategorizedOrder"]}},"required":["metrics_layout"]},"SettingsResponse":{"type":"object","properties":{"id":{"type":"integer"},"metrics_layout":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"metricIds":{"type":"array","items":{"type":"integer"}},"name":{"type":"string"}},"required":["id","name","metricIds"]}},"uncategorizedOrder":{"type":"array","items":{"type":"integer"}}},"required":["categories","uncategorizedOrder"]},"user_id":{"type":"integer"}},"required":["id","user_id","metrics_layout"]},"StopTimerSessionInput":{"type":"object","properties":{"metric_id":{"type":"integer"},"timestamp":{"type":"string"}},"required":["metric_id","timestamp"]},"StreamEntryInput":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]},"StreamEntryPinInput":{"type":"object","properties":{"id":{"type":"integer"}},"required":["id"]},"StreamEntryResponse":{"type":"object","properties":{"created_at":{"type":"string"},"id":{"type":"integer"},"pinned":{"type":"boolean"},"text":{"type":"string"},"user_id":{"type":"integer"}},"required":["id","user_id","text","created_at","pinned"]},"ThoughtDeleteInput":{"type":"object","properties":{"id":{"type":"integer"}},"required":["id"]},"ThoughtInput":{"type":"object","properties":{"body":{"type":"string"},"metric_id":{"type":"integer"},"people_ids":{"type":"array","items":{"type":"integer"}},"tags":{"type":"array","items":{"type":"string"}}},"required":["body","tags","people_ids"]},"ThoughtLinkInput":{"type":"object","properties":{"from_id":{"type":"integer"},"to_id":{"type":"integer"}},"required":["from_id","to_id"]},"ThoughtResponse":{"type":"object","properties":{"body":{"type":"string"},"created_at":{"type":"string"},"id":{"type":"integer"},"metric_id":{"type":"integer"},"metric_name":{"type":"string"},"people":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"nickname":{"type":"string"}},"required":["id","name"]}},"tags":{"type":"array","items":{"type":"string"}},"updated_at":{"type":"string"},"user_id":{"type":"integer"}},"required":["id","user_id","body","tags","people","created_at","updated_at"]},"ThoughtUpdateInput":{"type":"object","properties":{"body":{"type":"string"},"id":{"type":"integer"},"people_ids":{"type":"array","items":{"type":"integer"}},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","body","tags","people_ids"]},"Time":{"type":"string"},"TimerSessionInput":{"type":"object","properties":{"metric_id":{"type":"integer"},"timestamp":{"type":"string"}},"required":["metric_id"]},"TimerSessionResponse":{"type":"object","properties":{"id":{"type":"integer"},"metric_id":{"type":"integer"},"minutes_elapsed":{"type":"number","format":"double"},"session_end":{"type":"string"},"session_start":{"type":"string"},"status":{"type":"string"}},"required":["id","metric_id","session_start","status"]},"TranscribeResponse":{"type":"object","properties":{"transcript":{"type":"string"}},"required":["transcript"]},"calendarParams":{"type":"object","properties":{"month":{"type":"string"},"tz_offset":{"type":"integer"}},"required":["month","tz_offset"]},"calendarResponse":{"type":"object","properties":{"dates":{"type":"array","items":{"type":"string"}}},"required":["dates"]},"getMetricCountsParams":{"type":"object","properties":{"end_date":{"type":"string"},"start_date":{"type":"string"}},"required":["start_date","end_date"]},"linkedThoughtsParams":{"type":"object","properties":{"thought_id":{"type":"integer"}},"required":["thought_id"]},"startDateParam":{"type":"object","properties":{"start_date":{"type":"string"}},"required":["start_date"]},"streamDayParams":{"type":"object","properties":{"day":{"type":"string"},"tz_offset":{"type":"integer"}},"required":["day","tz_offset"]},"thoughtDateParams":{"type":"object","properties":{"date":{"type":"string"},"end_date":{"type":"string"},"start_date":{"type":"string"},"tz_offset":{"type":"integer"}},"required":["date","tz_offset","start_date","end_date"]},"timerSessionParams":{"type":"object","properties":{"metric_id":{"type":"integer"}},"required":["metric_id"]},"zone":{"type":"object"},"zoneTrans":{"type":"object"}}}}
