{"openapi":"3.1.0","info":{"title":"MailReplai API","description":"AI-powered email management for Outlook","version":"1.0.0"},"paths":{"/auth/verify":{"post":{"tags":["Authentication"],"summary":"Verify Token","description":"Verify user authentication token","operationId":"verify_token_auth_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenVerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenVerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["Authentication"],"summary":"Get Current User Info","description":"Get current user information","operationId":"get_current_user_info_auth_me_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"x-dev-mode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Dev-Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me/name":{"patch":{"tags":["Authentication"],"summary":"Update User Name","description":"Update current user's name","operationId":"update_user_name_auth_me_name_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"x-dev-mode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Dev-Mode"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNameRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/microsoft/check-permissions":{"get":{"tags":["Authentication"],"summary":"Check Microsoft Permissions","description":"Check Microsoft Graph API permissions for authenticated user\n\nSupports both shadow account (Outlook add-in) and JWT authentication (web app)","operationId":"check_microsoft_permissions_auth_microsoft_check_permissions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/microsoft/connection-health":{"get":{"tags":["Authentication"],"summary":"Check Connection Health","description":"Lightweight connection health check for the Outlook add-in shield indicator.\n\nReturns whether the Microsoft token is valid and categorization is running.\nUsed by the add-in to show/hide the reconnect shield icon.","operationId":"check_connection_health_auth_microsoft_connection_health_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionHealth"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/microsoft/request-authorization":{"get":{"tags":["Authentication"],"summary":"Request Microsoft Authorization","description":"Get Microsoft OAuth authorization URL with required scopes\n\nSupports both shadow account (Outlook add-in) and JWT authentication (web app)","operationId":"request_microsoft_authorization_auth_microsoft_request_authorization_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/microsoft/callback":{"post":{"tags":["Authentication"],"summary":"Microsoft Oauth Callback","description":"Handle Microsoft OAuth callback and store tokens\n\nSupports both shadow account and JWT authentication","operationId":"microsoft_oauth_callback_auth_microsoft_callback_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthCallbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthCallbackResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/microsoft/process-new-account":{"post":{"tags":["Authentication"],"summary":"Process New Microsoft Account","description":"Process a new account after successful OAuth consent","operationId":"process_new_microsoft_account_auth_microsoft_process_new_account_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"x-dev-mode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Dev-Mode"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessAccountRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/microsoft/initial-sync":{"post":{"tags":["Authentication"],"summary":"Initial Sync","description":"Run initial email sync after permission grant.\n\nProcesses emails and generates daily brief WITHOUT applying categories to Outlook.\nThis populates the daily brief data immediately after permission grant.\nCategories are stored with 'pending' writebacks and only applied when user activates.\n\nCalled automatically after successful OAuth.","operationId":"initial_sync_auth_microsoft_initial_sync_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitialSyncResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/microsoft/revoke":{"post":{"tags":["Authentication"],"summary":"Revoke Microsoft Permissions","description":"Revoke Microsoft Graph API permissions for authenticated user","operationId":"revoke_microsoft_permissions_auth_microsoft_revoke_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"x-dev-mode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Dev-Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/microsoft/token":{"get":{"tags":["Authentication"],"summary":"Get Microsoft Token","description":"Get valid Microsoft access token for authenticated user","operationId":"get_microsoft_token_auth_microsoft_token_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"x-dev-mode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Dev-Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/dev/token":{"post":{"tags":["Authentication"],"summary":"Get Dev Token","description":"Get a JWT token for development/testing purposes.\n\nDEV MODE ONLY - This endpoint is disabled in production.\nGenerates a valid JWT token for any existing user by email.","operationId":"get_dev_token_auth_dev_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/replies/generate":{"post":{"tags":["Replies"],"summary":"Generate Replies","description":"Generate AI-powered email replies - supports both authenticated and shadow accounts","operationId":"generate_replies_replies_generate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepliesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/replies/usage":{"get":{"tags":["Replies"],"summary":"Get Usage Info","description":"Get user's current usage information","operationId":"get_usage_info_replies_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"x-dev-mode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Dev-Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/drafts/generate":{"post":{"tags":["Drafts"],"summary":"Generate Draft","description":"Generate email draft - supports both authenticated and shadow accounts","operationId":"generate_draft_drafts_generate_post","parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftGenerationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftGenerationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/compose/generate":{"post":{"tags":["Compose"],"summary":"Generate Compose Email","description":"Generate structured email from command (to, subject, body)\n\nCreates a new email with proper structure based on user instruction.\nReturns:\n- to: Recipient email address (inferred or placeholder)\n- subject: Email subject line\n- body: Complete email body with greeting and closing\n\nSupports both authenticated users and shadow accounts.","operationId":"generate_compose_email_compose_generate_post","parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComposeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComposeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/transcription/audio":{"post":{"tags":["Transcription"],"summary":"Transcribe Audio","description":"Transcribe audio file to text using Groq Whisper API\n\nSupports both authenticated users and shadow accounts.\nAccepts audio files in WAV, MP3, M4A, etc.","operationId":"transcribe_audio_transcription_audio_post","parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_transcribe_audio_transcription_audio_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/thread-analysis/generate":{"post":{"tags":["Thread Analysis"],"summary":"Generate Thread Analysis","description":"Generate actions and summary for email thread\n\nAnalyzes email threads to extract:\n- Action items (0-3): Only when explicitly requested in the email\n- Summary points (1-5): Key information from the thread\n\nSupports both authenticated users and shadow accounts.\nMulti-language support - responds in the same language as the input email.","operationId":"generate_thread_analysis_thread_analysis_generate_post","parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadAnalysisRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadAnalysisResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups":{"get":{"tags":["Follow-ups"],"summary":"Get Followups","description":"Get follow-ups for the current user.\n\nArgs:\n    status: Filter by status (pending, snoozed, dismissed, replied). Default: pending\n    priority: Filter by priority (high, medium, low). Optional.","operationId":"get_followups_followups_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["pending","snoozed","dismissed","replied","sent"],"type":"string"},{"type":"null"}],"description":"Filter by status","default":"pending","title":"Status"},"description":"Filter by status"},{"name":"priority","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by priority (high, medium, low)","title":"Priority"},"description":"Filter by priority (high, medium, low)"},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowupsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups/count":{"get":{"tags":["Follow-ups"],"summary":"Get Followups Count","description":"Get count of pending follow-ups for badge display. Only returns counts for paid users.","operationId":"get_followups_count_followups_count_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__models__followup__CountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups/{followup_id}/opened":{"post":{"tags":["Follow-ups"],"summary":"Log Followup Opened","description":"Log that user opened the follow-up compose window (analytics).","operationId":"log_followup_opened_followups__followup_id__opened_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"followup_id","in":"path","required":true,"schema":{"type":"string","title":"Followup Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups/{followup_id}/snooze":{"patch":{"tags":["Follow-ups"],"summary":"Snooze Followup","description":"Snooze a follow-up for N days.\n\nArgs:\n    followup_id: UUID of the follow-up\n    snooze_request: Number of days to snooze (1-30)","operationId":"snooze_followup_followups__followup_id__snooze_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"followup_id","in":"path","required":true,"schema":{"type":"string","title":"Followup Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnoozeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups/{followup_id}/dismiss":{"patch":{"tags":["Follow-ups"],"summary":"Dismiss Followup","description":"Permanently dismiss a follow-up.","operationId":"dismiss_followup_followups__followup_id__dismiss_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"followup_id","in":"path","required":true,"schema":{"type":"string","title":"Followup Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups/{followup_id}":{"put":{"tags":["Follow-ups"],"summary":"Update Followup","description":"Update follow-up subject and/or AI-generated text.\n\nArgs:\n    followup_id: UUID of the follow-up\n    update_request: Updated subject and/or ai_followup_text","operationId":"update_followup_followups__followup_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"followup_id","in":"path","required":true,"schema":{"type":"string","title":"Followup Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFollowupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups/{followup_id}/send":{"put":{"tags":["Follow-ups"],"summary":"Send Followup","description":"Send a follow-up email via Microsoft Graph API.\n\nThis endpoint:\n1. Retrieves the follow-up details\n2. Sends the email via Microsoft Graph\n3. Updates status to 'sent'\n\nArgs:\n    followup_id: UUID of the follow-up to send","operationId":"send_followup_followups__followup_id__send_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"followup_id","in":"path","required":true,"schema":{"type":"string","title":"Followup Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups/reminders":{"get":{"tags":["Follow-ups"],"summary":"Get Reminders","description":"Get reminders for the current user.\n\nArgs:\n    status: Filter by status (pending, snoozed, dismissed, replied). Default: pending\n    priority: Filter by priority (high, medium, low). Optional.","operationId":"get_reminders_followups_reminders_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["pending","snoozed","dismissed","replied","sent"],"type":"string"},{"type":"null"}],"description":"Filter by status","default":"pending","title":"Status"},"description":"Filter by status"},{"name":"priority","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by priority (high, medium, low)","title":"Priority"},"description":"Filter by priority (high, medium, low)"},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemindersListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups/reminders/count":{"get":{"tags":["Follow-ups"],"summary":"Get Reminders Count","description":"Get count of pending reminders for badge display. Only returns counts for paid users.","operationId":"get_reminders_count_followups_reminders_count_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__models__followup__CountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups/reminders/{reminder_id}/opened":{"post":{"tags":["Follow-ups"],"summary":"Log Reminder Opened","description":"Log that user opened the reminder reply window (analytics).","operationId":"log_reminder_opened_followups_reminders__reminder_id__opened_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reminder_id","in":"path","required":true,"schema":{"type":"string","title":"Reminder Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups/reminders/{reminder_id}/snooze":{"patch":{"tags":["Follow-ups"],"summary":"Snooze Reminder","description":"Snooze a reminder for N days.\n\nArgs:\n    reminder_id: UUID of the reminder\n    snooze_request: Number of days to snooze (1-30)","operationId":"snooze_reminder_followups_reminders__reminder_id__snooze_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reminder_id","in":"path","required":true,"schema":{"type":"string","title":"Reminder Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnoozeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups/reminders/{reminder_id}/dismiss":{"patch":{"tags":["Follow-ups"],"summary":"Dismiss Reminder","description":"Permanently dismiss a reminder.","operationId":"dismiss_reminder_followups_reminders__reminder_id__dismiss_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reminder_id","in":"path","required":true,"schema":{"type":"string","title":"Reminder Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups/reminders/{reminder_id}":{"put":{"tags":["Follow-ups"],"summary":"Update Reminder","description":"Update reminder subject and/or AI-generated reply text.\n\nArgs:\n    reminder_id: UUID of the reminder\n    update_request: Updated subject and/or ai_reply_text","operationId":"update_reminder_followups_reminders__reminder_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reminder_id","in":"path","required":true,"schema":{"type":"string","title":"Reminder Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReminderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/followups/reminders/{reminder_id}/send":{"put":{"tags":["Follow-ups"],"summary":"Send Reminder","description":"Send a reminder reply via Microsoft Graph API.\n\nThis endpoint:\n1. Retrieves the reminder details\n2. Sends the reply via Microsoft Graph\n3. Updates status to 'replied'\n\nArgs:\n    reminder_id: UUID of the reminder to reply to","operationId":"send_reminder_followups_reminders__reminder_id__send_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reminder_id","in":"path","required":true,"schema":{"type":"string","title":"Reminder Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/todos":{"get":{"tags":["Todos"],"summary":"Get Todos","operationId":"get_todos_todos_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["pending","in_progress","completed","dismissed"],"type":"string"},{"type":"null"}],"description":"Filter by status","default":"pending","title":"Status"},"description":"Filter by status"},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TodosListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/todos/count":{"get":{"tags":["Todos"],"summary":"Get Todos Count","operationId":"get_todos_count_todos_count_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__models__todo__CountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/todos/{todo_id}/complete":{"patch":{"tags":["Todos"],"summary":"Toggle Todo Complete","operationId":"toggle_todo_complete_todos__todo_id__complete_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"todo_id","in":"path","required":true,"schema":{"type":"string","title":"Todo Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/todos/{todo_id}/dismiss":{"patch":{"tags":["Todos"],"summary":"Dismiss Todo","operationId":"dismiss_todo_todos__todo_id__dismiss_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"todo_id","in":"path","required":true,"schema":{"type":"string","title":"Todo Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/todos/{todo_id}/steps/{step_id}/toggle":{"patch":{"tags":["Todos"],"summary":"Toggle Step Complete","operationId":"toggle_step_complete_todos__todo_id__steps__step_id__toggle_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"todo_id","in":"path","required":true,"schema":{"type":"string","title":"Todo Id"}},{"name":"step_id","in":"path","required":true,"schema":{"type":"string","title":"Step Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/subscription/status":{"get":{"tags":["Subscription"],"summary":"Get Subscription Status","description":"Get user's subscription status and usage","operationId":"get_subscription_status_subscription_status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"x-dev-mode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Dev-Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/subscription/upgrade":{"post":{"tags":["Subscription"],"summary":"Upgrade Subscription","description":"Upgrade user to premium subscription (placeholder for Stripe integration)","operationId":"upgrade_subscription_subscription_upgrade_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"x-dev-mode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Dev-Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/subscription/reset-usage":{"post":{"tags":["Subscription"],"summary":"Reset Monthly Usage","description":"Reset monthly usage (admin function for testing)","operationId":"reset_monthly_usage_subscription_reset_usage_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"x-dev-mode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Dev-Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/subscription/outlook-status":{"get":{"tags":["Subscription"],"summary":"Get Outlook Subscription Status","description":"Get subscription status for Outlook add-in users.\n\nCheck order (highest priority first):\n1. Shadow account linked to paid account → Return paid tier\n2. Real account by email (personal subscription) → Return paid tier\n3. Real account by email (team subscription) → Return team tier\n4. Shadow account with free credits → Return free tier with credits\n5. New user (no account) → Return default free tier\n\nThis endpoint is public (no auth required) because Outlook add-in\nusers may not have authenticated yet.","operationId":"get_outlook_subscription_status_subscription_outlook_status_get","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","description":"User's email address","title":"Email"},"description":"User's email address"},{"name":"X-Shadow-Account-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutlookSubscriptionStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categorization/status":{"get":{"tags":["Categorization"],"summary":"Get Categorization Status By Email","description":"Get current categorization status.\nUses authenticated user from JWT. Email parameter is optional for backwards compatibility.","operationId":"get_categorization_status_by_email_categorization_status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categorization/process-emails":{"post":{"tags":["Categorization"],"summary":"Process New Emails","description":"Process and categorize new emails from inbox.\nUses JWT for authentication and fetches Microsoft token internally.","operationId":"process_new_emails_categorization_process_emails_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessEmailsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessEmailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categorization/activate":{"post":{"tags":["Categorization"],"summary":"Activate Categorization","description":"Activate email categorization.\nUses JWT for authentication and fetches Microsoft token internally.\nRequires an active subscription (status: active or trialing).\nThis will:\n1. Check subscription status\n2. Set activation flags\n3. Process and categorize the last 100 emails\n4. Create search folders for each category\n5. Apply computed categories to emails","operationId":"activate_categorization_categorization_activate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categorization/deactivate":{"post":{"tags":["Categorization"],"summary":"Deactivate Categorization","description":"Deactivate email categorization.\nUses JWT for authentication and fetches Microsoft token internally.\nThis will:\n1. Set deactivation flags\n2. Remove search folders\n3. Remove applied categories from emails","operationId":"deactivate_categorization_categorization_deactivate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeactivateCategorizationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categorization/categories":{"get":{"tags":["Categorization"],"summary":"Get Account Categories","description":"Get email categories for an account.\nUses JWT for authentication.","operationId":"get_account_categories_categorization_categories_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},{"name":"visible_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Visible Only"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmailCategory"},"title":"Response Get Account Categories Categorization Categories Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categorization/webhook/email":{"post":{"tags":["Categorization"],"summary":"Handle Email Webhook","description":"Handle webhook notifications for new emails.\nProcess them synchronously for real-time categorization.","operationId":"handle_email_webhook_categorization_webhook_email_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Notification"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categorization/debug/master-categories":{"get":{"tags":["Categorization"],"summary":"Debug Master Categories","description":"Debug endpoint to check current master categories with their colors","operationId":"debug_master_categories_categorization_debug_master_categories_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categorization/fix-category-colors":{"post":{"tags":["Categorization"],"summary":"Fix Category Colors","description":"Force update all master category colors to match database","operationId":"fix_category_colors_categorization_fix_category_colors_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categorization/custom-categories":{"get":{"tags":["Categorization"],"summary":"Get Custom Categories","description":"Get all custom categories for the current user's account.","operationId":"get_custom_categories_categorization_custom_categories_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Active Only"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomCategoryResponse"},"title":"Response Get Custom Categories Categorization Custom Categories Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Categorization"],"summary":"Create Custom Category","description":"Create a new custom category for the current user's account.\nMaximum 5 custom categories per account.","operationId":"create_custom_category_categorization_custom_categories_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomCategoryCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomCategoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categorization/custom-categories/{category_id}":{"put":{"tags":["Categorization"],"summary":"Update Custom Category","description":"Update an existing custom category.","operationId":"update_custom_category_categorization_custom_categories__category_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomCategoryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomCategoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Categorization"],"summary":"Delete Custom Category","description":"Delete a custom category (soft delete - sets active=false).","operationId":"delete_custom_category_categorization_custom_categories__category_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categorization/process-sent-emails":{"post":{"tags":["Categorization"],"summary":"Process Sent Emails","description":"Process sent emails from the user's Sent Items folder.\n\nThis endpoint:\n1. Fetches sent emails from Microsoft Graph\n2. Stores them in mail_messages with direction='outbound'\n3. Uses AI to determine if a reply is expected\n4. Applies '8. Awaiting Reply' or '9. Answered' labels\n5. Creates writebacks to sync labels to Outlook\n\nOnly emails where the AI determines needs_reply=true will get labels.\nConfirmations, FYI messages, and other emails without expected replies\nwill not receive labels.","operationId":"process_sent_emails_categorization_process_sent_emails_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessSentEmailsRequest","default":{"email_count":20}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessSentEmailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/shadow-account/create":{"post":{"tags":["Shadow Accounts"],"summary":"Create Shadow Account","description":"Create or retrieve shadow account for free trial","operationId":"create_shadow_account_shadow_account_create_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShadowAccountCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShadowAccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/shadow-account/status":{"get":{"tags":["Shadow Accounts"],"summary":"Get Shadow Account Status","description":"Get shadow account status and credits","operationId":"get_shadow_account_status_shadow_account_status_get","parameters":[{"name":"x-shadow-account-id","in":"header","required":true,"schema":{"type":"string","title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/shadow-account/reset-credits":{"post":{"tags":["Shadow Accounts"],"summary":"Reset Shadow Account Credits","description":"Reset shadow account credits for testing purposes (password protected)","operationId":"reset_shadow_account_credits_shadow_account_reset_credits_post","parameters":[{"name":"x-shadow-account-id","in":"header","required":true,"schema":{"type":"string","title":"X-Shadow-Account-Id"}},{"name":"X-Reset-Password","in":"header","required":true,"schema":{"type":"string","title":"X-Reset-Password"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/shadow-account/custom-instructions":{"get":{"tags":["Shadow Accounts"],"summary":"Get Custom Instructions","description":"Get custom instructions for shadow account","operationId":"get_custom_instructions_shadow_account_custom_instructions_get","parameters":[{"name":"x-shadow-account-id","in":"header","required":true,"schema":{"type":"string","title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomInstructionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Shadow Accounts"],"summary":"Update Custom Instructions","description":"Update custom instructions for shadow account","operationId":"update_custom_instructions_shadow_account_custom_instructions_put","parameters":[{"name":"x-shadow-account-id","in":"header","required":true,"schema":{"type":"string","title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomInstructionsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/shadow-account/info":{"get":{"tags":["Shadow Accounts"],"summary":"Get Account Info","description":"Get shadow account info including name and email","operationId":"get_account_info_shadow_account_info_get","parameters":[{"name":"x-shadow-account-id","in":"header","required":true,"schema":{"type":"string","title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/shadow-account/name":{"patch":{"tags":["Shadow Accounts"],"summary":"Update Name","description":"Update name for shadow account","operationId":"update_name_shadow_account_name_patch","parameters":[{"name":"x-shadow-account-id","in":"header","required":true,"schema":{"type":"string","title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNameRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/shadow-account/link":{"post":{"tags":["Shadow Accounts"],"summary":"Link Shadow Account","description":"Link shadow account to real account after user upgrades.\n\nThis preserves the user's custom instructions from their free trial.\nCalled by the frontend after user creates account and subscribes.","operationId":"link_shadow_account_shadow_account_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkShadowAccountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pipeline/status":{"get":{"tags":["Pipeline"],"summary":"Get Pipeline Status","description":"Get status of the most recent pipeline run.\nUsed for debugging and displaying last update time in UI.","operationId":"get_pipeline_status_pipeline_status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}},{"name":"x-dev-mode","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Dev-Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PipelineStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/brief":{"get":{"tags":["Daily Brief"],"summary":"Get Daily Brief","description":"Get the daily brief for a specific date.\nReturns cached brief data generated by the daily pipeline.","operationId":"get_daily_brief_brief_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"brief_date","in":"query","required":false,"schema":{"type":"string","format":"date","description":"Date for the brief (defaults to today)","title":"Brief Date"},"description":"Date for the brief (defaults to today)"},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyBriefResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/brief/todos/{todo_id}":{"patch":{"tags":["Daily Brief"],"summary":"Update Todo","description":"Update a todo item (e.g., toggle completion)","operationId":"update_todo_brief_todos__todo_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"todo_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Todo Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTodoRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefTodo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/brief/marketing/archive":{"post":{"tags":["Daily Brief"],"summary":"Archive Marketing Emails","description":"Archive marketing emails (marks as archived in brief and moves to archive in Outlook)","operationId":"archive_marketing_emails_brief_marketing_archive_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveMarketingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveMarketingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/brief/day-counts":{"get":{"tags":["Daily Brief"],"summary":"Get Day Counts","description":"Get email counts per day for the day selector chips.","operationId":"get_day_counts_brief_day_counts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","description":"Number of recent days to return","default":14,"title":"Days"},"description":"Number of recent days to return"},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DayCountsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/brief/day-emails":{"get":{"tags":["Daily Brief"],"summary":"Get Day Emails","description":"Get ALL inbound emails for a specific day with their classification metadata.\nReturns emails sorted by priority (needs_reply first, then importance_score).","operationId":"get_day_emails_brief_day_emails_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"brief_date","in":"query","required":false,"schema":{"type":"string","format":"date","description":"Date for emails (defaults to today)","title":"Brief Date"},"description":"Date for emails (defaults to today)"},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DayEmailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/brief/email/{message_id}/body":{"get":{"tags":["Daily Brief"],"summary":"Get Email Body","description":"Get the full email body for a specific message (for AI reply generation).","operationId":"get_email_body_brief_email__message_id__body_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailBodyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/brief/archive-day":{"post":{"tags":["Daily Brief"],"summary":"Archive Day","description":"Archive all non-'Needs Reply' emails for a given day.\nMoves emails to Archive folder in Outlook via Graph API.","operationId":"archive_day_brief_archive_day_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveDayRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveDayResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/brief/generate":{"post":{"tags":["Daily Brief"],"summary":"Generate Brief","description":"Manually trigger brief generation.\nUsed for testing or manual refresh.","operationId":"generate_brief_brief_generate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"brief_date","in":"query","required":false,"schema":{"type":"string","format":"date","description":"Date for the brief (defaults to today)","title":"Brief Date"},"description":"Date for the brief (defaults to today)"},{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateBriefResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/metrics":{"get":{"tags":["Admin"],"summary":"Get Admin Metrics","description":"Get admin metrics for monitoring\n\nRequires X-Admin-Key header with valid admin API key\n\nReturns:\n    dict: {\n        \"total_users\": int,\n        \"signups_today\": int,\n        \"signups_this_week\": int,\n        \"active_subscriptions\": int,\n        \"mrr\": float,\n        \"api_costs_today\": float,\n        \"api_costs_this_week\": float,\n        \"api_costs_this_month\": float,\n        \"emails_generated_today\": int\n    }","operationId":"get_admin_metrics_admin_metrics_get","parameters":[{"name":"x-admin-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/health":{"get":{"tags":["Admin"],"summary":"Admin Health Check","description":"Admin health check endpoint\n\nRequires X-Admin-Key header with valid admin API key","operationId":"admin_health_check_admin_health_get","parameters":[{"name":"x-admin-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/settings/followup":{"get":{"tags":["Settings"],"summary":"Get Followup Settings","description":"Get follow-up settings for the authenticated user's account.","operationId":"get_followup_settings_settings_followup_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowupSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Settings"],"summary":"Update Followup Settings","description":"Update follow-up settings for the authenticated user's account.","operationId":"update_followup_settings_settings_followup_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-shadow-account-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Shadow-Account-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowupSettingsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowupSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inngest":{"get":{"summary":"Get Api Inngest","operationId":"get_api_inngest_api_inngest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"summary":"Put Inngest Api","operationId":"put_inngest_api_api_inngest_put","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Post Inngest Api","operationId":"post_inngest_api_api_inngest_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"summary":"Root","description":"Root endpoint for health check","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health Check","description":"Health check endpoint","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/detailed":{"get":{"summary":"Detailed Health Check","description":"Detailed health check with dependency status","operationId":"detailed_health_check_health_detailed_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"ActivateResponse":{"properties":{"status":{"type":"string","title":"Status"},"folders_created":{"type":"integer","title":"Folders Created"},"emails_updated":{"type":"integer","title":"Emails Updated"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status","folders_created","emails_updated"],"title":"ActivateResponse"},"ArchiveDayRequest":{"properties":{"date":{"type":"string","format":"date","title":"Date"}},"type":"object","required":["date"],"title":"ArchiveDayRequest"},"ArchiveDayResponse":{"properties":{"archived_count":{"type":"integer","title":"Archived Count"},"kept_count":{"type":"integer","title":"Kept Count"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["archived_count","kept_count"],"title":"ArchiveDayResponse"},"ArchiveMarketingRequest":{"properties":{"message_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Message Ids"}},"type":"object","required":["message_ids"],"title":"ArchiveMarketingRequest"},"ArchiveMarketingResponse":{"properties":{"archived_count":{"type":"integer","title":"Archived Count"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["archived_count"],"title":"ArchiveMarketingResponse"},"AuthorizationInfo":{"properties":{"authorization_url":{"type":"string","title":"Authorization Url"},"state":{"type":"string","title":"State"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"}},"type":"object","required":["authorization_url","state","scopes"],"title":"AuthorizationInfo"},"Body_transcribe_audio_transcription_audio_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"}},"type":"object","required":["file"],"title":"Body_transcribe_audio_transcription_audio_post"},"BriefMeeting":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_id":{"type":"string","title":"Event Id"},"title":{"type":"string","title":"Title"},"start_at":{"type":"string","format":"date-time","title":"Start At"},"end_at":{"type":"string","format":"date-time","title":"End At"},"attendees":{"items":{"$ref":"#/components/schemas/MeetingAttendee"},"type":"array","title":"Attendees","default":[]},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"},"is_online":{"type":"boolean","title":"Is Online","default":false},"meeting_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meeting Url"}},"type":"object","required":["id","event_id","title","start_at","end_at"],"title":"BriefMeeting"},"BriefTodo":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"description":{"type":"string","title":"Description"},"origin_sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin Sender"},"origin_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin Subject"},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date"},"completed":{"type":"boolean","title":"Completed","default":false},"priority":{"type":"string","title":"Priority","default":"medium"}},"type":"object","required":["id","description"],"title":"BriefTodo"},"ComposeRequest":{"properties":{"command":{"type":"string","title":"Command"},"custom_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Instructions"},"existing_email":{"anyOf":[{"$ref":"#/components/schemas/ExistingEmail"},{"type":"null"}]}},"type":"object","required":["command"],"title":"ComposeRequest","description":"Request model for composing a new email or editing an existing one"},"ComposeResponse":{"properties":{"to":{"type":"string","title":"To"},"subject":{"type":"string","title":"Subject"},"body":{"type":"string","title":"Body"},"credits_remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Remaining"},"usage_warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Warning"}},"type":"object","required":["to","subject","body"],"title":"ComposeResponse","description":"Response model for composed email with structured output"},"ConnectionHealth":{"properties":{"connected":{"type":"boolean","title":"Connected"},"token_valid":{"type":"boolean","title":"Token Valid"},"token_expired":{"type":"boolean","title":"Token Expired"},"categorization_active":{"type":"boolean","title":"Categorization Active"},"needs_reauth":{"type":"boolean","title":"Needs Reauth"}},"type":"object","required":["connected","token_valid","token_expired","categorization_active","needs_reauth"],"title":"ConnectionHealth"},"CustomCategoryCreate":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"color":{"type":"string","title":"Color"},"color_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color Name"},"example_sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Example Sender"},"example_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Example Subject"},"example_body_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Example Body Snippet"}},"type":"object","required":["name","color"],"title":"CustomCategoryCreate","description":"Request to create a custom category"},"CustomCategoryResponse":{"properties":{"id":{"type":"string","title":"Id"},"account_id":{"type":"string","title":"Account Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"color":{"type":"string","title":"Color"},"color_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color Name"},"example_sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Example Sender"},"example_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Example Subject"},"example_body_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Example Body Snippet"},"active":{"type":"boolean","title":"Active"},"order_index":{"type":"integer","title":"Order Index"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","account_id","name","color","active","order_index","created_at","updated_at"],"title":"CustomCategoryResponse","description":"Response model for custom category"},"CustomCategoryUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"},"color_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color Name"},"example_sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Example Sender"},"example_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Example Subject"},"example_body_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Example Body Snippet"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},"type":"object","title":"CustomCategoryUpdate","description":"Request to update a custom category"},"CustomInstructionsResponse":{"properties":{"custom_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Instructions"},"shadow_account_id":{"type":"string","title":"Shadow Account Id"}},"type":"object","required":["shadow_account_id"],"title":"CustomInstructionsResponse"},"CustomInstructionsUpdate":{"properties":{"custom_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Instructions"}},"type":"object","title":"CustomInstructionsUpdate"},"DailyBriefResponse":{"properties":{"brief_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Brief Id"},"date":{"type":"string","format":"date","title":"Date"},"generated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Generated At"},"important_emails":{"items":{"$ref":"#/components/schemas/ImportantEmail"},"type":"array","title":"Important Emails","default":[]},"todos":{"items":{"$ref":"#/components/schemas/BriefTodo"},"type":"array","title":"Todos","default":[]},"todays_meetings":{"items":{"$ref":"#/components/schemas/BriefMeeting"},"type":"array","title":"Todays Meetings","default":[]},"yesterdays_meetings":{"items":{"$ref":"#/components/schemas/BriefMeeting"},"type":"array","title":"Yesterdays Meetings","default":[]},"newsletters":{"items":{"$ref":"#/components/schemas/NewsletterSummary"},"type":"array","title":"Newsletters","default":[]},"marketing":{"items":{"$ref":"#/components/schemas/MarketingEmail"},"type":"array","title":"Marketing","default":[]},"calendar_connected":{"type":"boolean","title":"Calendar Connected","default":false}},"type":"object","required":["date"],"title":"DailyBriefResponse"},"DayCount":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["date","count"],"title":"DayCount"},"DayCountsResponse":{"properties":{"days":{"items":{"$ref":"#/components/schemas/DayCount"},"type":"array","title":"Days","default":[]}},"type":"object","title":"DayCountsResponse"},"DayEmail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"message_id":{"type":"string","format":"uuid","title":"Message Id"},"sender":{"type":"string","title":"Sender"},"subject":{"type":"string","title":"Subject"},"snippet":{"type":"string","title":"Snippet","default":""},"received_at":{"type":"string","format":"date-time","title":"Received At"},"web_link":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Web Link"},"category":{"type":"string","title":"Category","default":"Uncategorized"},"needs_reply":{"type":"boolean","title":"Needs Reply","default":false},"importance_score":{"type":"integer","title":"Importance Score","default":0},"is_newsletter":{"type":"boolean","title":"Is Newsletter","default":false},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]}},"type":"object","required":["id","message_id","sender","subject","received_at"],"title":"DayEmail"},"DayEmailsResponse":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"emails":{"items":{"$ref":"#/components/schemas/DayEmail"},"type":"array","title":"Emails","default":[]},"total_count":{"type":"integer","title":"Total Count","default":0}},"type":"object","required":["date"],"title":"DayEmailsResponse"},"DeactivateCategorizationResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"hidden_count":{"type":"integer","title":"Hidden Count"}},"type":"object","required":["success","message","hidden_count"],"title":"DeactivateCategorizationResponse"},"DevTokenRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"DevTokenRequest"},"DevTokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"}},"type":"object","required":["access_token","user_id","email"],"title":"DevTokenResponse"},"DraftGenerationRequest":{"properties":{"email_context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Email Context"},"command":{"type":"string","title":"Command"}},"type":"object","required":["command"],"title":"DraftGenerationRequest"},"DraftGenerationResponse":{"properties":{"draft":{"type":"string","title":"Draft"},"credits_remaining":{"type":"integer","title":"Credits Remaining"},"usage_warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Warning"}},"type":"object","required":["draft","credits_remaining"],"title":"DraftGenerationResponse"},"EmailBodyResponse":{"properties":{"message_id":{"type":"string","title":"Message Id"},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"body_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Html"},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"}},"type":"object","required":["message_id"],"title":"EmailBodyResponse"},"EmailCategory":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"email_id":{"type":"string","title":"Email Id"},"category_id":{"type":"string","format":"uuid","title":"Category Id"},"category_name":{"type":"string","title":"Category Name"},"confidence_score":{"type":"number","title":"Confidence Score","default":1.0},"email_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Subject"},"email_sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Sender"},"email_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Email Date"},"email_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Content"},"visible":{"type":"boolean","title":"Visible","default":true},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","user_id","email_id","category_id","category_name","created_at","updated_at"],"title":"EmailCategory"},"EmailContext":{"properties":{"sender":{"type":"string","title":"Sender"},"sender_email":{"type":"string","title":"Sender Email"},"subject":{"type":"string","title":"Subject"},"body":{"type":"string","title":"Body"},"received_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Received At"},"conversation_history":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Conversation History"}},"type":"object","required":["sender","sender_email","subject","body"],"title":"EmailContext","description":"Email context for generating replies"},"ExistingEmail":{"properties":{"to":{"type":"string","title":"To"},"subject":{"type":"string","title":"Subject"},"body":{"type":"string","title":"Body"}},"type":"object","required":["to","subject","body"],"title":"ExistingEmail","description":"Model for existing email context when editing"},"FollowupResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"account_id":{"type":"string","format":"uuid","title":"Account Id"},"origin_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Origin Message Id"},"provider_message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Message Id"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Snippet"},"recipients":{"items":{"type":"string"},"type":"array","title":"Recipients"},"sent_at":{"type":"string","format":"date-time","title":"Sent At"},"days_since_sent":{"type":"integer","title":"Days Since Sent","default":0},"priority":{"type":"string","enum":["high","medium","low"],"title":"Priority","default":"medium"},"ai_followup_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Followup Text"},"status":{"type":"string","enum":["pending","snoozed","dismissed","replied","sent"],"title":"Status","default":"pending"},"remind_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Remind At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","account_id","sent_at","created_at","updated_at"],"title":"FollowupResponse","description":"Response model for a follow-up (mail_followups table)"},"FollowupSettingsRequest":{"properties":{"followup_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Followup Enabled"},"followup_delay_days":{"anyOf":[{"type":"integer","maximum":30.0,"minimum":1.0},{"type":"null"}],"title":"Followup Delay Days"},"followup_quiet_hours":{"anyOf":[{"$ref":"#/components/schemas/QuietHours"},{"type":"null"}]}},"type":"object","title":"FollowupSettingsRequest"},"FollowupSettingsResponse":{"properties":{"followup_enabled":{"type":"boolean","title":"Followup Enabled"},"followup_delay_days":{"type":"integer","title":"Followup Delay Days"},"followup_quiet_hours":{"anyOf":[{"$ref":"#/components/schemas/QuietHours"},{"type":"null"}]}},"type":"object","required":["followup_enabled","followup_delay_days"],"title":"FollowupSettingsResponse"},"FollowupsListResponse":{"properties":{"followups":{"items":{"$ref":"#/components/schemas/FollowupResponse"},"type":"array","title":"Followups"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["followups","count"],"title":"FollowupsListResponse","description":"Response model for list of follow-ups"},"GenerateBriefResponse":{"properties":{"brief_id":{"type":"string","format":"uuid","title":"Brief Id"},"date":{"type":"string","format":"date","title":"Date"},"status":{"type":"string","title":"Status"},"important_count":{"type":"integer","title":"Important Count","default":0},"todos_count":{"type":"integer","title":"Todos Count","default":0},"meetings_today_count":{"type":"integer","title":"Meetings Today Count","default":0},"meetings_yesterday_count":{"type":"integer","title":"Meetings Yesterday Count","default":0},"newsletters_count":{"type":"integer","title":"Newsletters Count","default":0},"marketing_count":{"type":"integer","title":"Marketing Count","default":0}},"type":"object","required":["brief_id","date","status"],"title":"GenerateBriefResponse"},"GeneratedReply":{"properties":{"id":{"type":"string","title":"Id"},"text":{"type":"string","title":"Text"},"tone":{"type":"string","title":"Tone"},"confidence":{"type":"number","title":"Confidence"},"preview_sentence":{"type":"string","title":"Preview Sentence"}},"type":"object","required":["id","text","tone","confidence","preview_sentence"],"title":"GeneratedReply","description":"Generated reply response"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImportantEmail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Message Id"},"sender":{"type":"string","title":"Sender"},"subject":{"type":"string","title":"Subject"},"snippet":{"type":"string","title":"Snippet"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]},"web_link":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Web Link"},"priority":{"type":"integer","title":"Priority","default":0}},"type":"object","required":["id","sender","subject","snippet"],"title":"ImportantEmail"},"InitialSyncResponse":{"properties":{"status":{"type":"string","title":"Status"},"emails_processed":{"type":"integer","title":"Emails Processed"},"emails_categorized":{"type":"integer","title":"Emails Categorized"},"brief_generated":{"type":"boolean","title":"Brief Generated"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status","emails_processed","emails_categorized","brief_generated"],"title":"InitialSyncResponse"},"LinkShadowAccountRequest":{"properties":{"shadow_account_id":{"type":"string","title":"Shadow Account Id"},"account_id":{"type":"string","title":"Account Id"}},"type":"object","required":["shadow_account_id","account_id"],"title":"LinkShadowAccountRequest"},"MarketingEmail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Message Id"},"sender":{"type":"string","title":"Sender"},"subject":{"type":"string","title":"Subject"},"tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"},"archived":{"type":"boolean","title":"Archived","default":false}},"type":"object","required":["id","sender","subject"],"title":"MarketingEmail"},"MeetingAttendee":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"MeetingAttendee"},"NewsletterSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"sender_domain":{"type":"string","title":"Sender Domain"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"},"email_count":{"type":"integer","title":"Email Count","default":1},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"}},"type":"object","required":["id","sender_domain"],"title":"NewsletterSummary"},"OAuthCallbackRequest":{"properties":{"code":{"type":"string","title":"Code"},"state":{"type":"string","title":"State"},"expected_state":{"type":"string","title":"Expected State"}},"type":"object","required":["code","state","expected_state"],"title":"OAuthCallbackRequest"},"OAuthCallbackResult":{"properties":{"success":{"type":"boolean","title":"Success"},"user_info":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Info"},"granted_scopes":{"items":{"type":"string"},"type":"array","title":"Granted Scopes"},"expires_at":{"type":"string","title":"Expires At"},"has_required_permissions":{"type":"boolean","title":"Has Required Permissions"}},"type":"object","required":["success","granted_scopes","expires_at","has_required_permissions"],"title":"OAuthCallbackResult"},"OutlookSubscriptionStatus":{"properties":{"tier":{"type":"string","title":"Tier"},"unlimited":{"type":"boolean","title":"Unlimited"},"credits_remaining":{"type":"integer","title":"Credits Remaining"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"is_team_subscription":{"type":"boolean","title":"Is Team Subscription","default":false},"next_reset_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Reset Date"}},"type":"object","required":["tier","unlimited","credits_remaining"],"title":"OutlookSubscriptionStatus","description":"Subscription status response for Outlook add-in"},"PermissionStatus":{"properties":{"has_permissions":{"type":"boolean","title":"Has Permissions"},"missing_scopes":{"items":{"type":"string"},"type":"array","title":"Missing Scopes"},"granted_scopes":{"items":{"type":"string"},"type":"array","title":"Granted Scopes"},"token_valid":{"type":"boolean","title":"Token Valid"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"details":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Details"}},"type":"object","required":["has_permissions","missing_scopes","granted_scopes","token_valid"],"title":"PermissionStatus"},"PipelineStatusResponse":{"properties":{"last_run":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"users_processed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Users Processed"},"followups_created":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Followups Created"},"reminders_created":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reminders Created"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"}},"type":"object","title":"PipelineStatusResponse","description":"Response model for pipeline status"},"ProcessAccountRequest":{"properties":{"user_email":{"type":"string","title":"User Email"},"access_token":{"type":"string","title":"Access Token"}},"type":"object","required":["user_email","access_token"],"title":"ProcessAccountRequest"},"ProcessEmailsRequest":{"properties":{"email_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Email Count","default":20}},"type":"object","title":"ProcessEmailsRequest","description":"Request to process emails - no access_token needed, fetched internally"},"ProcessEmailsResponse":{"properties":{"status":{"type":"string","title":"Status"},"processed":{"type":"integer","title":"Processed"},"categorized":{"type":"integer","title":"Categorized"},"skipped":{"type":"integer","title":"Skipped"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status","processed","categorized","skipped"],"title":"ProcessEmailsResponse"},"ProcessSentEmailsRequest":{"properties":{"email_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Email Count","default":20}},"type":"object","title":"ProcessSentEmailsRequest","description":"Request to process sent emails"},"ProcessSentEmailsResponse":{"properties":{"status":{"type":"string","title":"Status"},"processed":{"type":"integer","title":"Processed"},"awaiting_reply":{"type":"integer","title":"Awaiting Reply"},"answered":{"type":"integer","title":"Answered"},"no_reply_needed":{"type":"integer","title":"No Reply Needed"},"skipped":{"type":"integer","title":"Skipped"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status","processed","awaiting_reply","answered","no_reply_needed","skipped"],"title":"ProcessSentEmailsResponse"},"QuietHours":{"properties":{"start":{"type":"string","title":"Start"},"end":{"type":"string","title":"End"},"timezone":{"type":"string","title":"Timezone"}},"type":"object","required":["start","end","timezone"],"title":"QuietHours"},"ReminderResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"account_id":{"type":"string","format":"uuid","title":"Account Id"},"origin_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Origin Message Id"},"provider_message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Message Id"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Snippet"},"from_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Address"},"received_at":{"type":"string","format":"date-time","title":"Received At"},"days_since_received":{"type":"integer","title":"Days Since Received","default":0},"priority":{"type":"string","enum":["high","medium","low"],"title":"Priority","default":"medium"},"ai_reply_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Reply Text"},"status":{"type":"string","enum":["pending","snoozed","dismissed","replied","sent"],"title":"Status","default":"pending"},"remind_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Remind At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","account_id","received_at","created_at","updated_at"],"title":"ReminderResponse","description":"Response model for a reminder (mail_reminders table)"},"RemindersListResponse":{"properties":{"reminders":{"items":{"$ref":"#/components/schemas/ReminderResponse"},"type":"array","title":"Reminders"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["reminders","count"],"title":"RemindersListResponse","description":"Response model for list of reminders"},"RepliesResponse":{"properties":{"replies":{"items":{"$ref":"#/components/schemas/GeneratedReply"},"type":"array","title":"Replies"},"remaining_usage":{"type":"integer","title":"Remaining Usage"},"user_id":{"type":"string","title":"User Id"},"usage_warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Warning"}},"type":"object","required":["replies","remaining_usage","user_id"],"title":"RepliesResponse","description":"Response containing multiple reply suggestions"},"ReplyRequest":{"properties":{"email_context":{"$ref":"#/components/schemas/EmailContext"},"custom_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Instructions"},"tone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tone","default":"professional"}},"type":"object","required":["email_context"],"title":"ReplyRequest","description":"Request model for generating replies"},"ShadowAccountCreate":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"source":{"type":"string","title":"Source"}},"type":"object","required":["email","source"],"title":"ShadowAccountCreate"},"ShadowAccountResponse":{"properties":{"shadow_account_id":{"type":"string","title":"Shadow Account Id"},"email":{"type":"string","title":"Email"},"credits_remaining":{"type":"integer","title":"Credits Remaining"},"next_refill_at":{"type":"string","format":"date-time","title":"Next Refill At"}},"type":"object","required":["shadow_account_id","email","credits_remaining","next_refill_at"],"title":"ShadowAccountResponse"},"SnoozeRequest":{"properties":{"days":{"type":"integer","maximum":30.0,"minimum":1.0,"title":"Days","description":"Number of days to snooze (1-30)"}},"type":"object","required":["days"],"title":"SnoozeRequest","description":"Request model for snoozing a follow-up or reminder"},"SubscriptionStatus":{"properties":{"tier":{"type":"string","title":"Tier"},"replies_used":{"type":"integer","title":"Replies Used"},"replies_limit":{"type":"integer","title":"Replies Limit"},"remaining_usage":{"type":"integer","title":"Remaining Usage"},"reset_date":{"type":"string","format":"date-time","title":"Reset Date"},"is_premium":{"type":"boolean","title":"Is Premium"}},"type":"object","required":["tier","replies_used","replies_limit","remaining_usage","reset_date","is_premium"],"title":"SubscriptionStatus"},"ThreadAnalysisRequest":{"properties":{"email_context":{"$ref":"#/components/schemas/EmailContext"},"custom_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Instructions"}},"type":"object","required":["email_context"],"title":"ThreadAnalysisRequest","description":"Request model for thread analysis"},"ThreadAnalysisResponse":{"properties":{"actions":{"items":{"type":"string"},"type":"array","title":"Actions"},"summary":{"items":{"type":"string"},"type":"array","title":"Summary"},"credits_remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Remaining"},"usage_warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Warning"}},"type":"object","required":["actions","summary"],"title":"ThreadAnalysisResponse","description":"Response model for thread analysis"},"TodoResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"account_id":{"type":"string","format":"uuid","title":"Account Id"},"title":{"type":"string","title":"Title"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date"},"due_datetime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Datetime"},"priority":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}],"title":"Priority","default":"medium"},"status":{"type":"string","enum":["pending","in_progress","completed","dismissed"],"title":"Status","default":"pending"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"email_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Subject"},"email_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email From"},"email_web_link":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Web Link"},"has_attachments":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Attachments","default":false},"ai_extracted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ai Extracted","default":true},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"steps":{"items":{"$ref":"#/components/schemas/TodoStepResponse"},"type":"array","title":"Steps","default":[]}},"type":"object","required":["id","account_id","title","created_at","updated_at"],"title":"TodoResponse"},"TodoStepResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"todo_id":{"type":"string","format":"uuid","title":"Todo Id"},"title":{"type":"string","title":"Title"},"order_index":{"type":"integer","title":"Order Index","default":0},"completed":{"type":"boolean","title":"Completed","default":false},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","todo_id","title","created_at","updated_at"],"title":"TodoStepResponse"},"TodosListResponse":{"properties":{"todos":{"items":{"$ref":"#/components/schemas/TodoResponse"},"type":"array","title":"Todos"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["todos","count"],"title":"TodosListResponse"},"TokenVerifyRequest":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"TokenVerifyRequest"},"TokenVerifyResponse":{"properties":{"user":{"$ref":"#/components/schemas/User"},"valid":{"type":"boolean","title":"Valid"}},"type":"object","required":["user","valid"],"title":"TokenVerifyResponse"},"TranscriptionResponse":{"properties":{"text":{"type":"string","title":"Text"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"duration":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration"},"credits_remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Remaining"},"usage_warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usage Warning"}},"type":"object","required":["text"],"title":"TranscriptionResponse","description":"Response model for audio transcription"},"UpdateFollowupRequest":{"properties":{"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject","description":"Updated subject line"},"ai_followup_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Followup Text","description":"Updated AI follow-up text"}},"type":"object","title":"UpdateFollowupRequest","description":"Request model for updating a follow-up"},"UpdateNameRequest":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"UpdateNameRequest"},"UpdateReminderRequest":{"properties":{"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject","description":"Updated subject line"},"ai_reply_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Reply Text","description":"Updated AI reply text"}},"type":"object","title":"UpdateReminderRequest","description":"Request model for updating a reminder"},"UpdateTodoRequest":{"properties":{"completed":{"type":"boolean","title":"Completed"}},"type":"object","required":["completed"],"title":"UpdateTodoRequest"},"User":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","created_at"],"title":"User","description":"User model"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"app__models__followup__CountResponse":{"properties":{"count":{"type":"integer","title":"Count"}},"type":"object","required":["count"],"title":"CountResponse","description":"Response model for count endpoints"},"app__models__todo__CountResponse":{"properties":{"count":{"type":"integer","title":"Count"}},"type":"object","required":["count"],"title":"CountResponse"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}