{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/login":{"get":{"summary":"Dashboard Login Page","operationId":"dashboard_login_page_login_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"summary":"Dashboard Login","operationId":"dashboard_login_login_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dashboard/logout":{"post":{"summary":"Dashboard Logout","operationId":"dashboard_logout_dashboard_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dashboard":{"get":{"summary":"Dashboard Index","operationId":"dashboard_index_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/dashboard/api/rating-popup":{"get":{"summary":"Dashboard Rating Popup Get","operationId":"dashboard_rating_popup_get_dashboard_api_rating_popup_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Dashboard Rating Popup Set","operationId":"dashboard_rating_popup_set_dashboard_api_rating_popup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/start-loops":{"post":{"summary":"Start Loops","description":"Starts all background loops that should only run on the production container.\nCalled by restart.sh after the new container is healthy — not by local dev instances.\n\nProtected by X-Internal-Key header (same shared secret as other /internal/* endpoints).","operationId":"start_loops_internal_start_loops_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/scheduled-send/start":{"post":{"summary":"Start Scheduled Send","description":"Start ONLY the Send Later dispatcher (start-loops also starts the digest\nand ads loops, which a local bridge must not run against production data).\nIdempotent. Protected by X-Internal-Key.","operationId":"start_scheduled_send_internal_scheduled_send_start_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/mem-trace/arm":{"post":{"summary":"Mem Trace Arm","description":"Arm the allocation tracer for the next memory ramp.\n\nMust be called at a TROUGH — tracemalloc only sees allocations made after it\nstarts, so arming at a peak measures nothing, and arming mid-ramp names the\ntail of the allocation rather than its source. The call refuses above\nmem_trace.ARM_MAX_BLOCKS rather than returning a confident wrong answer.\n\nIt fires once, a couple of seconds into the ramp while the heap is still\nsmall, snapshots in a worker thread, and stops tracing on every exit path.\n\nProtected by X-Internal-Key header (same secret as other /internal/* endpoints).","operationId":"mem_trace_arm_internal_mem_trace_arm_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/mem-trace/report":{"get":{"summary":"Mem Trace Report","description":"Probe status, and once captured the ranked allocation sites.\n\nRead `traced_share_of_rss` FIRST. Near 1.0 means the heap is traced Python\nobjects and `top_by_line` names them. Near 0 means the memory never went\nthrough Python's allocator, and reading application code will not find it\nhowever long anyone looks.","operationId":"mem_trace_report_internal_mem_trace_report_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/mem-trace/disarm":{"post":{"summary":"Mem Trace Disarm","description":"Cancel an armed probe and stop tracing. Safe to call when idle.","operationId":"mem_trace_disarm_internal_mem_trace_disarm_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/loop-status":{"get":{"summary":"Loop Status","description":"Whether the background loops are actually ALIVE, not merely asked to start. The\ncontainer self-restarts while start-loops is non-fatal, so a crashed worker leaves\nthe bridge healthy and serving while the outbox silently stops draining.\n\nALERT ON `<loop>.stale` (nested — there is no top-level field): asked to run, not\nticking. It is a BACKSTOP, near 50 min for gads, since stale_after must clear one\ninterval plus the longest legitimate tick. The per-tick `[gads] sweep tick #N` log\nis the low-latency signal.","operationId":"loop_status_internal_loop_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/account-watchdog/start":{"post":{"summary":"Start Account Watchdog","description":"Start the account watchdog: alerts the debug Slack channel when a\nsingle account's requests have been timing out continuously for 30 minutes\n(rate limits and auth errors excluded), attaches that account's recent logs\nin-thread, re-alerts every 6h while it stays down, and posts once when it\nrecovers. Loads its state from Redis here (the one read it does), so it\nsurvives restarts. Idempotent.\n\nProtected by X-Internal-Key header (same secret as other /internal/* endpoints).","operationId":"start_account_watchdog_internal_account_watchdog_start_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/metrics":{"get":{"summary":"Metrics","description":"Prometheus scrape endpoint.\n\nAuthenticated with the same shared secret as the /internal routes, because\nnginx fronts this on a public hostname. The payload holds no user data — no\naddresses, no message contents — but it does enumerate every route, its\ntraffic volume and error rate, and the counter resets betray deploy timing.","operationId":"metrics_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/support/account":{"get":{"summary":"Internal Support Account","description":"Read-only account summary for dove-support's researcher.\n\nGET only, SUPPORT_READ_API_KEY only. Returns every live Dove Account the\nemail is linked to with subscription, trial, platforms, app versions and\nlinked mail accounts (with live session counts). Never ids, keys or\ncredentials. See core/support_lookup.py.","operationId":"internal_support_account_internal_support_account_get","parameters":[{"name":"email","in":"query","required":false,"schema":{"type":"string","default":"","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/accounts":{"get":{"summary":"Internal Accounts","description":"Account list for the Grafana log-search dropdown.\n\nReturns Grafana's variable shape — `__text` is what the dropdown displays\nand filters on, `__value` is the bare email substituted into the LogQL\nquery:\n\n    {\"__text\": \"a@b.com (gmail) (2/1)\", \"__value\": \"a@b.com\"}\n\nBecause the dropdown filters on the display text, packing the provider and\nthe session/websocket counts in means typing \"imap\" narrows to IMAP\naccounts, and the list sorts the connected accounts to the top.\n\nThis is built purely from live state — the accounts map and the session\nmanager. It used to union in every account BridgeLogger had seen and tag\neach one with its error count, both read from the logger's in-memory ring\nbuffers; those are gone. An account that is idle right now is therefore not\nin this list — the log dashboard's free-text **Contains** box reaches it,\nand it greps the log lines themselves, which is where the errors live now\nanyway.\n\nAuthenticated with the internal key, same as /metrics: this is a list of\nreal user email addresses and must not be public.","operationId":"internal_accounts_internal_accounts_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":2000,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/create-session":{"post":{"summary":"Create Session","operationId":"create_session_create_session_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oauth/yahoo/token":{"post":{"summary":"Yahoo Web Token","description":"Redeem a Yahoo authorization code for the web app.\n\nYahoo's token endpoint sends no CORS headers, so a browser cannot redeem\nthe code the way Gmail web does; it sends the code and its PKCE verifier\nhere instead. See core.yahoo_account.exchange_web_code.\n\nBody: {\"code\", \"code_verifier\", \"redirect_uri\"}.\n200 {\"success\": True, \"tokens\": {...}} | 4xx/502 {\"success\": False, \"error\", \"error_description\"}","operationId":"yahoo_web_token_oauth_yahoo_token_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/validate-credentials":{"post":{"summary":"Validate Credentials","description":"Validate IMAP credentials without creating a session.\n\nUsed by the client before opening a socket connection to get structured\nerrors (autodiscover_failed, oauth_provider_required) as plain JSON.\n\nReturns:\n    200  {\"success\": True}\n    401  {\"success\": False, \"error\": \"...\"}\n    422  {\"success\": False, \"error\": \"...\", \"error_code\": \"...\", \"error_detail\": {...}}","operationId":"validate_credentials_validate_credentials_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oauth/graph/web/exchange":{"post":{"summary":"Graph Web Exchange","description":"The web app's Microsoft sign-in, redeemed by the bridge as the\nconfidential client (GRAPH_WEB_CONFIDENTIAL, default off: 404 as an\nunknown route; core/graph_web_oauth.py, docs/graph_web_confidential.md).\n\nBody: {code, code_verifier, redirect_uri}. Called before any login exists,\nso, as /create-session and /validate-credentials, it takes no session or\nkey: what authenticates it is the single-use code, bound by Microsoft to\nthis client, the PKCE verifier only the browser that started the sign-in\nholds, and a redirect_uri equal to the registered Web one.\n200 {access_token, refresh_token, expires_in, id_token?, scope,\nconfidential: true}; 400 {\"error\": \"bad_request\" | \"bad_redirect_uri\"};\n400 {\"error\": \"exchange_failed\", oauth_error, error_description};\n502 {\"error\": \"exchange_unavailable\"}; 503 {\"error\": \"unavailable\"}\n(no secret configured).","operationId":"graph_web_exchange_oauth_graph_web_exchange_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ping":{"get":{"summary":"Ping","operationId":"ping_ping_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/action":{"post":{"summary":"Http Action","description":"HTTP transport for heavy data operations.\nMirrors the Socket.IO message handler but over standard HTTP,\nbypassing middlebox interference with large WebSocket frames.\n\nHeaders:\n    X-Session-ID: session_id\n    X-Auth-Key: auth_key\n\nBody (JSON):\n    { \"action\": \"fetch\", \"params\": { ... } }\n\nResponse (JSON):\n    Success: { \"result\": { ... } }\n    Error:   { \"error\": \"message\" }","operationId":"http_action_api_v1_action_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/notify":{"post":{"summary":"Internal Notify","description":"Generic internal webhook from the cluster server.\n\nEmits an arbitrary Socket.IO event to all active sessions for the given\naccount. Adding a new cross-device notification type requires no bridge\nchanges — just call this endpoint with the desired event name.\n\nBody:\n    email  (str)  — account to notify\n    event  (str)  — socket event name to emit, e.g. \"action_sync\"\n    dove_account_id (str) — optional: the notice is about this Dove\n             Account's data (its Today Areas), so it reaches only devices\n             of it. A mailbox can be linked to several Dove Accounts; a\n             device the bridge cannot place still gets it. Absent: every\n             session, as before.\n    extra  (dict) — optional extra fields forwarded to the socket payload\n\nKnown events (any name is relayed): action_sync, attention_sync (dove-\ncluster), today_profile_changed, today_area_rows_changed,\nsmart_draft_changed (dove-search), read receipts (dove-receipts),\nclassification_changed (dove-agent: `rfc_message_ids`, `pipeline_version`;\na cue only, the app re-reads those classifications), and setup_done\n(dove-agent: `state` done | failed, `ftue_version`; the server setup of a\nserver-owned mailbox finished, so the app restores it).\n\nX-Internal-Key: checked under INTERNAL_NOTIFY_KEY_MODE (log | enforce,\ndefault log). `log` counts keyless and wrong-key callers and proceeds as\nbefore; `enforce` answers 401 (core/internal_auth_checks.py).","operationId":"internal_notify_internal_notify_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/dove-agent/validate":{"post":{"summary":"Internal Dove Agent Validate","description":"Whether a Dove Account may enroll a mailbox (contract 2,\ndocs/dove_agent_routes.md). Body: dove_account_id, auth_key, account_email.\nAnswers valid / linked / readable / provider / is_web / dove_account_ids.","operationId":"internal_dove_agent_validate_internal_dove_agent_validate_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/dove-agent/session":{"post":{"summary":"Internal Dove Agent Session","description":"Open a bridge session from the mailbox's login on a Dove Account,\ntagged with `purpose` (dove_agent | notifications | dove_agent_write, the\nlast running actions only while the mailbox is owned). Opening one creates no watch; on\na dove_agent session the `watch` action is refused, and a dove_agent_write\nsession runs `move` alone.","operationId":"internal_dove_agent_session_internal_dove_agent_session_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/dove-agent/session/close":{"post":{"summary":"Internal Dove Agent Session Close","description":"Close a session /internal/dove-agent/session opened.","operationId":"internal_dove_agent_session_close_internal_dove_agent_session_close_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/dove-agent/links":{"post":{"summary":"Internal Dove Agent Links","description":"Every Dove Account linked to the mailbox, read fresh from Mongo (no\ncache), for dove-agent's delete on a last unlink (docs/dove_agent_routes.md).\nBody: account_email. A failed read answers 503, never an empty list.","operationId":"internal_dove_agent_links_internal_dove_agent_links_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/dove-agent/work_owner":{"post":{"summary":"Internal Dove Agent Work Owner","description":"Store who starts a mailbox's per-email work (contract §11.2,\ndocs/dove_agent_routes.md \"Work ownership\"). Body: account_email,\nwork_owner (server | app). Honoured at once by this process, by the\nothers within their 60 s refresh.","operationId":"internal_dove_agent_work_owner_internal_dove_agent_work_owner_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/dove-agent/sent_extraction":{"post":{"summary":"Internal Dove Agent Sent Extraction","description":"The fetch hook's Sent gate and /internal/extract_emails payload for one\nmessage dove-agent read itself (contract §11.4, Sent `extract`). Body:\naccount_email, provider_id, message, ignore_extracted_mark? (a\nre-extraction after the user gained entitlement: the dispatch mark, which\nalso counts a refused call, is not read). Side-effect free. 503\n{\"error\": \"unavailable\", \"reason\"} when the answer could not be prepared\n(a failed read): never a final eligible:false.","operationId":"internal_dove_agent_sent_extraction_internal_dove_agent_sent_extraction_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/apple/retention-message":{"post":{"summary":"Apple Retention Message","description":"Apple's Get Retention Message call, made when someone taps Cancel\nSubscription on a Dove App Store subscription: answers with the message,\nor the message and a signed 50% promotional offer\n(core/apple_retention_messaging.py). Authenticated by Apple's signature on\nthe body. Must answer within 700 ms; any non-200 makes Apple show the App\nStore Connect message and offers instead.","operationId":"apple_retention_message_apple_retention_message_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/rc/webhook":{"post":{"summary":"Rc Webhook","description":"Receive RevenueCat webhook events.\nExtracts dove_account_id from app_user_id, re-fetches purchase status from RC,\nand updates the in-memory cache.","operationId":"rc_webhook_rc_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/cio/cancel-survey":{"post":{"summary":"Cio Cancel Survey","description":"Receive a Customer.io `form_submit` from the cancellation exit survey and post the\ntyped answer into that subscriber's Slack thread in the revenue channel.\n\nCustomer.io retries on a non-2xx, so this answers 200 on anything it managed to\nparse — a verbatim we can't attribute is still worth posting, and a redelivery of\none we already posted would only double it in Slack.","operationId":"cio_cancel_survey_cio_cancel_survey_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/cio/lifecycle-alert":{"post":{"summary":"Cio Lifecycle Alert","description":"A lifecycle journey asking for a human (core/lifecycle_alerts): today R1's \"no email\non the profile after 2 hours\". Customer.io webhook, same Authorization secret as\n/cio/cancel-survey. Answers 200 on anything verified and parseable, since Customer.io\nretries a non-2xx and a retry would post twice.","operationId":"cio_lifecycle_alert_cio_lifecycle_alert_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/cio/reporting":{"post":{"summary":"Cio Reporting","description":"Customer.io reporting webhook. Only the exit-survey reason taps matter here: an\nin-app click whose tracked response is a cancellation reason is written back to\nthe profile as `cancellation_reason` (see core/cancellation_reason).\n\nEvery other event is acknowledged and dropped. Answers 200 on anything verified\nand parseable — Customer.io retries a non-2xx, and a redelivered tap only\nrewrites the same value.","operationId":"cio_reporting_cio_reporting_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/support/contacted":{"post":{"summary":"Support Contacted Mark","description":"The support inbox says a person replied to us (or `source: \"call\"` for a call\nbooked some other way). Body: {\"email\": \"...\", \"source\": \"reply\" | \"call\"};\nheader X-Support-Key. Answers `matched: false` for an address no live Dove\nAccount knows, so the caller can see it was not marked.","operationId":"support_contacted_mark_support_contacted_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/calendly/webhook":{"post":{"summary":"Calendly Webhook","description":"Calendly webhook subscription (`invitee.created`): a booked call marks the booker\nas contacted. Verified by Calendly's signature; every other event is acknowledged\nand dropped, and a redelivery only rewrites the same traits.","operationId":"calendly_webhook_calendly_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/dove-account/set-tester":{"post":{"summary":"Internal Set Tester","description":"Internal endpoint to set internal_tester on a Dove Account.\n\nBody:\n    email            (str)  — look up by email\n    internal_tester  (bool) — target value","operationId":"internal_set_tester_internal_dove_account_set_tester_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/dove-account/account-split":{"post":{"summary":"Internal Set Account Split","description":"Operator override of a Dove Account's arm in one per-account split (QA).\nOverwrites.\n\nBody:\n    dove_account_id  (str)\n    key              (str) an app_config.ACCOUNT_SPLITS key\n    value            one of that split's values, or null to take the\n                     account out of the test for good (a later sync\n                     doesn't re-assign it)","operationId":"internal_set_account_split_internal_dove_account_account_split_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/qa/account":{"post":{"summary":"Internal Qa Account","description":"Marks or unmarks a QA account (core/qa_accounts.py, docs/qa_accounts.md).\nBody: {\"email\" or \"dove_account_id\", \"qa\": true | false}.","operationId":"internal_qa_account_internal_qa_account_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/qa/setup":{"post":{"summary":"Internal Qa Setup","description":"Puts a QA account where a test needs it (core/qa_accounts.py setup).\nBody: {\"email\" or \"dove_account_id\", \"free_week_started_hours_ago\"?,\n\"groups\"?: {\"value_moment_offer_enabled\" | \"recap_emails_enabled\":\ntrue | false | null}, \"reset\"?: bool}.","operationId":"internal_qa_setup_internal_qa_setup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/smart-drafts/context":{"post":{"summary":"Internal Smart Drafts Context","description":"One mailbox's thread for a Smart draft (dove-search). See docs/smart_drafts_context.md.\n\nBody:\n    account_id       (str)  the mailbox\n    rfc_message_id   (str)  a message of the thread (the seed used to find it)\n    mode             (\"full\" | \"state\")\n    kind             (\"reply\" | \"follow_up\", optional; anything else is reply)\n    counterparty     (str, optional) the awaited person, for follow_up\n\nfull answers reply_all/from_address on the answered message: the newest for a\nreply, the user's newest message to the counterparty for a follow_up.","operationId":"internal_smart_drafts_context_internal_smart_drafts_context_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/ask-dove/read-email":{"post":{"summary":"Internal Ask Dove Read Email","description":"One email of the requesting Dove Account's own mailbox, for Ask Dove's\nread_email tool (dove-search). See docs/ask_dove_read_email.md.\n\nBody:\n    dove_account_id  (str)  required\n    account_id       (str)  the mailbox, required\n    rfc_message_id   (str)  \"<id>\", \"id\" or \"msg_<id>\", required\n    start            (int >= 0, default 0)\n    length           (int 1..6000, default 6000; above 6000 is clamped)\n    auth_key         (str, optional) the Dove Account auth key","operationId":"internal_ask_dove_read_email_internal_ask_dove_read_email_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/referral/config":{"get":{"summary":"Internal Referral Config Get","description":"Read the referral switches.\nResponse: { enabled: bool, sandbox_payouts: bool, play_trial_defer: bool,\n            degraded: bool } — `degraded` only on a read failure.","operationId":"internal_referral_config_get_internal_referral_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Internal Referral Config Set","description":"Flip the referral kill switch.\n\nBody: any of { enabled: bool }, { sandbox_payouts: bool },\n{ play_trial_defer: bool }\n\nExists because a switch nobody can reach is not a kill switch. Referral\nrewards cost real money, so shutting the programme off has to be a single\ncall at 3am — not a deploy, and not a hand-written Mongo update against the\nproduction replica set.\n\nTurning it off refuses new claims at /referral/use before any ledger write.\nRewards already granted are untouched, and codes already issued stay valid\nfor when it is turned back on.","operationId":"internal_referral_config_set_internal_referral_config_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/run-digest":{"post":{"summary":"Internal Run Digest","description":"Internal endpoint to run the Daily Digest compute.\n\nDriven by a 30-minute cron (timezone bucketing happens via each user's local window).\nGated to the DIGEST_ALLOWLIST until DIGEST_ALL_USERS=true (§9.3).\n\nBody (optional):\n    email  (str)  — run for a single Dove Account (by main_email) on demand for testing.\n                    Omit to run the full gated batch.","operationId":"internal_run_digest_internal_run_digest_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/feature/check":{"post":{"summary":"Feature Check","description":"Check if a feature is allowed. Internal server-to-server endpoint only.\nBody: { feature, dove_account_id? | email?, with_dove_accounts? }\nProvide dove_account_id for a direct DA lookup, or email for an email→DA lookup.\nResponse: { allowed, unlock_at }, plus dove_account_ids (the mailbox's\nallowed Dove Accounts) for an email lookup with with_dove_accounts: true\n(CLAUDE.md, \"Today Dove Accounts Per Mailbox\"), and then allowed_until\n(epoch seconds) when one of those is in a trial: the earliest trial end\n(docs/dove_agent_routes.md).","operationId":"feature_check_feature_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/timezone_for_email":{"post":{"summary":"Internal Timezone For Email","description":"Return what classification-gated task extraction needs to know about the\naccount behind an email: the IANA timezone of the Dove Account linked to it\n(main or secondary; \"\" if unknown), which the cluster stamps on\ncurrent_time, every address that is this mailbox's user (the login,\nthe aliases added in the app, the provider's as last saved), which\ndove-search reads the user's recipient role from, and the app language\nToday tasks are written in (\"\" if unknown; CLAUDE.md, \"Today User\nLanguage\"), with every language it is also written in (`locales`, main\nfirst; one per device language), and, only when the body asks for it\nwith `include_archive_on_done: true` (the cluster's daily priors), whether\nDone archives the mail (`archive_on_done`: true if any linked Dove\nAccount's synced setting is true; false when unset or unreadable). It is\nasked for, not always sent, because this route is called for every mail\nand the read is uncached. Internal server-to-server (X-Internal-Key).\nBody: { email, include_archive_on_done? }.\nResponse: { timezone, addresses, locale, locales[, archive_on_done] }.","operationId":"internal_timezone_for_email_internal_timezone_for_email_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/app/config":{"get":{"summary":"App Config Get","description":"Public endpoint: everything the app needs in order to decide what to show.\n\nResponse: {\n    config:   { \"<key>\": bool | int, ... },\n    versions: { \"<key>\": int, ... }\n}\n\nTwo flat maps rather than one map of {value, version} objects, so \"config\"\nstays a plain bag of bools and ints that the client can read generically —\nwhich is the property that makes adding a key free on both sides.\n\nThe client stores what it receives and keeps serving it; a value only\ndisplaces a stored one when its version goes UP. See core/app_config.py\nfor what that buys and for the two different kinds of edit it creates.\n\nUnauthenticated and account-independent, exactly as /rating-popup/config\nwas: the app reads this before it has a Dove Account to identify itself\nwith, and nothing here is per-user.\n\nThe client sends X-Device-Id when it has one, and A/B split keys (a\n{value: weight} dict in APP_CONFIG) are resolved per device from it. With\nno id those keys are left out, so the client uses its own default instead\nof storing one arm for good. See core/app_config.py.\n\nNever cached: the body differs per device, so a cache keyed on the URL\nalone would hand one device's arms to everyone behind it.\n\nNo I/O, deliberately. Every value is an in-process constant, so there is\nno database read on a path that every install hits on every cold launch —\nand no exception path either, which is what lets this route be the one\nthing the client can always get an answer from.","operationId":"app_config_get_app_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/rating-popup/config":{"get":{"summary":"Rating Popup Config Get","description":"Public endpoint called by the app to check if the rating popup is globally enabled.\nResponse: { enabled: bool }\n\nSuperseded by /app/config, which carries the same flag alongside the rest.\nKept, and kept correct, because shipped builds poll this one and there is\nno version of the app that stops needing an answer — see the note on\n/promo/config for what happens to a route the client still calls.\n\nReads the same static_config() as /app/config rather than keeping its own\nsource, so the two cannot disagree. It no longer consults the Mongo kill\nswitch — see the note on KEY_RATING_POPUP_ENABLED in core/app_config.py,\nwhich also covers the dashboard toggle that used to write it.","operationId":"rating_popup_config_get_rating_popup_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/promo/config":{"get":{"summary":"Promo Config Get","description":"Compatibility shim for app versions that predate referrals.\n\nThose builds poll this before drawing the (now-removed) influencer\npromo-code section and hide it only on an explicit {\"enabled\": false}. The\nclient fails OPEN to true, so a 404 (which this route became when the\ninfluencer feature was deleted) or any 5xx makes it draw the dead promo UI\nagain. The influencer programme was replaced by referrals and is not coming\nback on those builds, so this always reports the feature off.\n\nHardcoded false rather than reading a kill-switch document, which is the\nshape this route had before deletion: a config read can raise, and any\nraise here becomes the client's fail-open-to-true — the single outcome this\nroute exists to prevent. With no I/O there is no such path. Newer clients\ndo not call this route.","operationId":"promo_config_get_promo_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/notify":{"post":{"summary":"Gmail Push Notification","description":"Receive Gmail push notifications from Google Cloud Pub/Sub.\n\nExpected format from Pub/Sub:\n{\n    \"message\": {\n        \"data\": \"base64-encoded-string\",\n        \"messageId\": \"...\",\n        \"publishTime\": \"...\"\n    },\n    \"subscription\": \"...\"\n}\n\nThe decoded data contains:\n{\n    \"emailAddress\": \"user@gmail.com\",\n    \"historyId\": \"123456\"\n}\n\nThe push's bearer token is checked under PUBSUB_OIDC_MODE (off | log |\nenforce, default off; core/internal_auth_checks.py).","operationId":"gmail_push_notification_notify_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/graph-notify":{"get":{"summary":"Graph Validation","description":"Handle Graph subscription validation (GET request with validationToken).","operationId":"graph_validation_graph_notify_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Graph Push Notification","description":"Receive Microsoft Graph push notifications.\n\nGraph sends two types of requests:\n1. Validation: POST with ?validationToken=xxx (during subscription creation)\n2. Notification: POST with JSON payload\n\nNotification payload:\n{\n    \"value\": [\n        {\n            \"subscriptionId\": \"...\",\n            \"clientState\": \"...\",\n            \"changeType\": \"created\",\n            \"resource\": \"Users/.../messages/...\",\n            \"resourceData\": {\n                \"@odata.type\": \"#Microsoft.Graph.Message\",\n                \"id\": \"...\"\n            }\n        }\n    ]\n}","operationId":"graph_push_notification_graph_notify_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/calendar-notify/google":{"post":{"summary":"Calendar Google Notification","description":"Google Calendar push (events.watch channels — core/calendars/push.py).\n\nThe body is empty; everything is in headers. `sync` is the handshake\nGoogle sends when a channel is created and carries no change. Always 200:\nanything else makes Google retry, and an unknown channel is simply one this\nprocess no longer tracks.","operationId":"calendar_google_notification_calendar_notify_google_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/calendar-notify/graph":{"get":{"summary":"Calendar Graph Validation","operationId":"calendar_graph_validation_calendar_notify_graph_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Calendar Graph Notification","description":"Microsoft Graph calendar subscriptions (core/calendars/push.py).\n\nValidation during subscription creation is a POST with ?validationToken\nthat must be echoed as text/plain; notifications carry the clientState the\nsubscription was created with.","operationId":"calendar_graph_notification_calendar_notify_graph_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/img":{"get":{"summary":"Img","operationId":"img_img_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/init":{"post":{"summary":"Da Init","description":"Create or return the Dove Account for the given email.\nRequires a valid (email, device_id) pair known to AuthStore.\nBody: { email, device_id }","operationId":"da_init_dove_account_init_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/lookup":{"post":{"summary":"Da Lookup","description":"Pre-init lookup for the Primary Account Found flow: reports whether the email\nis a SECONDARY account of an existing Dove Account, so the client can offer\nresume-via-primary-OAuth before /init mints a fresh account.\nRequires a valid (email, device_id) pair known to AuthStore, like /init.\nBody: { email, device_id }\nReturns 200 {\"found\": false} when the email is unlinked or is a main_email\n(those resume via /init as today). Never returns auth_key or dove_account_id.","operationId":"da_lookup_dove_account_lookup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/start-trial":{"post":{"summary":"Da Start Trial","description":"Explicitly start the 7-day trial for a v4+ Dove Account.\nCalled from the client during onboarding when the user declines the store IAP.\nIdempotent — safe to call even if the trial has already been started.\nHeaders: X-Dove-Account-Id, X-Dove-Auth-Key, X-Device-Id","operationId":"da_start_trial_dove_account_start_trial_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/attribution":{"post":{"summary":"Da Attribution","description":"First-touch attribution backfill, independent of trial start.\nThe app POSTs the gclid/utm bundle as soon as it captures it (e.g. when the\nOAuth /success relay lands after /init has already fired), so the account\ncarries attribution before any purchase webhook. First-touch server-side —\nnever overwrites an existing bundle.\nHeaders: X-Dove-Account-Id, X-Dove-Auth-Key. Body: {\"attribution\": {...}}","operationId":"da_attribution_dove_account_attribution_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/digest":{"get":{"summary":"Da Get Digest","description":"Return the stored Daily Digest for this Dove Account (in-app view).\nHeaders: X-Dove-Account-Id, X-Dove-Auth-Key","operationId":"da_get_digest_dove_account_digest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/digest/refresh":{"post":{"summary":"Da Refresh Digest","description":"Recompute the Daily Digest for this Dove Account on demand and return the fresh result.\nUser-initiated, so it bypasses the scheduler's timezone/window/once-per-day gates (those live\nin run_digest, not run_for_dove_account). Headers: X-Dove-Account-Id, X-Dove-Auth-Key","operationId":"da_refresh_digest_dove_account_digest_refresh_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/verify":{"post":{"summary":"Da Verify","description":"Verify Apple TestFlight/App Store proof for this Dove Account.\nBody: { kind, platform, jws? | receipt_data? }","operationId":"da_verify_dove_account_verify_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/link-web-identity":{"post":{"summary":"Da Link Web Identity","operationId":"da_link_web_identity_dove_account_link_web_identity_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/referral/reward/reserve":{"post":{"summary":"Referral Reward Reserve","description":"Reserve one earned month before the client redeems it as a promotional\noffer. Body: { da_id, auth_key, months? }\n\nApple pays a referral out as a promotional offer, which only the customer\ncan redeem — there is no server-side API for it. So the balance is spent\nhere, immediately before the StoreKit purchase, and handed back by\n/referral/reward/release if that purchase does not complete.\n\nReserving first is deliberate: RevenueCat does not report which promotional\noffer a purchase used, so we cannot confirm a redemption after the fact. A\nreservation for an abandoned purchase costs a retry; the other way round\nhands out the same month twice.","operationId":"referral_reward_reserve_referral_reward_reserve_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/referral/reward/extend-trial":{"post":{"summary":"Referral Reward Extend Trial","description":"Spend earned months as reverse-trial time. Body: { da_id, auth_key, months? }\n\nThe escape hatch for a referrer who cannot use a promotional offer: Apple\nsigns those only for accounts with subscription history, so a referrer who\nhas never paid holds months they cannot spend. This converts them into the\none currency a non-subscriber can actually receive.\n\nSpending and granting are a single atomic update in the store, which is\nwhat stops a referral being paid twice — the earlier design wrote trial\ndays and left the balance intact, so the same month was live as trial time\nand still redeemable later as an offer.\n\n409 when the balance cannot cover the request, or when the account is not\neligible (an active store subscriber, who should take the offer instead;\na legacy account, which already has unlimited access).","operationId":"referral_reward_extend_trial_referral_reward_extend_trial_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/referral/reward/release":{"post":{"summary":"Referral Reward Release","description":"Hand back one reservation whose redemption did not complete.\n\nBody: { da_id, auth_key, reservation_id }. The id is the whole security\nmodel: a release is only ever the undo of a specific, recent, still-open\nreservation issued by /referral/reward/reserve. Without it, an\nauthenticated client could \"release\" months that were already delivered\nby any payout path and re-earn them forever. The months come from the\nledgered reservation, never from the request.","operationId":"referral_reward_release_referral_reward_release_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/referral/use":{"post":{"summary":"Referral Use","description":"Claim a referral code for this Dove Account.\n\nBody: { code, da_id, auth_key, device_id, platform?, plan? }\n\nWhen `platform` is supplied the response also carries the store purchase\ntarget for the referral sign-up offer (first month free, then the normal\nprice) under \"offer\". A referred user's free month comes from that store\noffer, not from the reward balance — only the referrer is paid from the\nbalance. `plan` (\"monthly\" | \"yearly\") picks which product's offer to\nreturn and defaults to monthly.\n\nThe REFERRER's reward is gated on the claimer having an active RevenueCat\nmandate — a free month per code is trivially farmable with throwaway\naccounts otherwise. (The referred user's own month is not gated here: it is\nthe store offer they buy through, and the store enforces its own\neligibility.) So:\n\n  * mandate already live  -> claim now, both sides get their month\n  * no mandate yet        -> park it as pending; the RC webhook fulfils it when\n                             rc_state first reports trial/subscriber\n\n`device_id` is the hardware id of the device that created the account. It goes\ninto a per-device ledger that outlives the account, so deleting and recreating\na Dove Account cannot earn the same hardware a second month.\n\nEvery guard (per-account, per-device, per-email) lives in\nDoveAccountStore.add_referral_claim and is enforced identically on both paths.\nThe parked path additionally dry-runs them before storing, so its *feedback*\nmatches too — otherwise a permanently-rejectable claim is told \"pending\" and\nrefused later where nobody is looking.\n\nThe kill switch is enforced in DoveAccounts.execute_referral_claim, the single\nentry point to every ledger write, so the deferred path is covered as well.\n\nBoth accepted responses answer with `referrer_name` as well as the offer\ntargets. It used to come only from /dove-account/init and sync, so a code\napplied mid-session rendered its price copy at once and its \"<name> invited\nyou\" line not at all — the name turned up on the next app start. Safe to\nreveal here for the reason referrer_name_for gives: the claim has just\npassed the ledgers, so this cannot be driven in a loop to work out whose\ncode is whose.","operationId":"referral_use_referral_use_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/referral/claim/clear":{"post":{"summary":"Referral Claim Clear","description":"Drop a PARKED referral claim. Body: { da_id, auth_key }\n\nThe rules live in DoveAccounts.clear_pending_referral_claim — why only a\nparked claim can go, and why a settled one must not.\n\n409 for a claim already settled. Clearing when nothing is parked is a\nsuccess with cleared=false, so a double tap is not an error.","operationId":"referral_claim_clear_referral_claim_clear_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/fingerprint":{"post":{"summary":"Store Fingerprint","operationId":"store_fingerprint_fingerprint_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"get":{"summary":"Lookup Fingerprint","description":"Called by native apps (iOS primary, others as fallback) on first launch.\nReturns the Mixpanel distinct_id for the given sha256 fingerprint, or 404.","operationId":"lookup_fingerprint_fingerprint_get","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dove-account/objects":{"post":{"summary":"Da Upsert Object","description":"Upsert an object in the Dove Account.\nCreates the object on first call; updates data on subsequent calls with the same object_id.\nBody: { object_id, object_type, data }","operationId":"da_upsert_object_dove_account_objects_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/objects/{object_id}":{"delete":{"summary":"Da Delete Object","description":"Delete an object.","operationId":"da_delete_object_dove_account_objects__object_id__delete","parameters":[{"name":"object_id","in":"path","required":true,"schema":{"type":"string","title":"Object Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/dove-account/app-version":{"post":{"summary":"Da Report App Version","description":"dove-analytics forwards each user's session_started client_version here (at\nmost once per user per 30 min), so builds that don't send app_version on\ninit/sync still keep first/last app version current. See core/app_versions.py.\nBody: { email, app_version }. Protected by X-Internal-Key.","operationId":"da_report_app_version_internal_dove_account_app_version_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/trial-recap":{"get":{"summary":"Da Trial Recap","description":"The end-of-trial popup's data: the account's latest ending (trial or\nPro lapse), whether its popup was already seen on any device, and — when\nnot — what Dove did over its window. See core/trial_recap.py.","operationId":"da_trial_recap_dove_account_trial_recap_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/trial-recap/seen":{"post":{"summary":"Da Trial Recap Seen","description":"Marks the current ending's popup seen, for every device on the account.\nBody: {\"ending_id\": \"<id from GET /dove-account/trial-recap>\"}. An id that\nis not the current ending (stale, or a newer ending has since happened)\nis refused, so a late call cannot hide a newer popup.","operationId":"da_trial_recap_seen_dove_account_trial_recap_seen_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/retention-offer":{"get":{"summary":"Da Retention Offer","description":"What the retention offer owes the account now (core/retention_offer.py):\nthe day-2 popup, the timing test's day-2 prompt (nudge) and value-moment\noffer, and until when Settings and the banner keep the offer. Older builds\nread only day2, offer and trial_day. The downsell rides the trial recap's\nresponse instead.","operationId":"da_retention_offer_dove_account_retention_offer_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/retention-offer/shown":{"post":{"summary":"Da Retention Offer Shown","description":"Records that a retention-offer popup was shown — once per account, so\nNot now (or Continue with Basic) means it never comes back.\nBody: {\"prompt\": \"day2\" | \"downsell\" | \"value_moment\" | \"value_nudge\"}.","operationId":"da_retention_offer_shown_dove_account_retention_offer_shown_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/retention-offer/apply":{"post":{"summary":"Da Retention Offer Apply","description":"Apply offer: the purchase targets for the retention offer on this\nplatform, in the shape /referral/use returns them ({\"offers\", \"offer\"}).\nNothing is stored for the offer itself — it lives on the paywall the\nclient opens with it, and is gone if the user does not buy there.\nBody: {\"prompt\": \"day2\" | \"downsell\" | \"value_moment\", \"platform\": ...,\n\"plan\": ..., \"trigger\": one of retention_offer.TRIGGERS,\n\"from_value_nudge\": bool}; trigger and from_value_nudge are kept for the\nfunnel events.","operationId":"da_retention_offer_apply_dove_account_retention_offer_apply_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/retention-offer/banner-closed":{"post":{"summary":"Da Retention Offer Banner Closed","description":"The offer banner was closed: gone for good, on every device. The\nSettings entry stays until the free week ends.","operationId":"da_retention_offer_banner_closed_dove_account_retention_offer_banner_closed_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/value-moment":{"post":{"summary":"Da Value Moment","description":"Records the account's first value moment of a kind during the free\nweek. Body: {\"moment\": one of retention_offer.MOMENTS, \"source\": e.g.\n\"typed\"}. Answers {\"first\", \"hours_since_signup\"}: the app sends\nvalue_moment_reached on first, so once per account, not per device.","operationId":"da_value_moment_dove_account_value_moment_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/billing/checkout":{"post":{"summary":"Billing Checkout","description":"A Stripe Checkout URL for Dove Pro. DA headers.\nBody: {\"plan\": \"monthly\"|\"yearly\", \"platform\": \"web\"|\"windows\"|\"linux\",\n       \"offer\": \"referral\"|\"retention\"|null}.\n200 {\"url\"}; refusals {\"error\": code} — already_subscribed (409, open the\nportal instead), offer_not_available (409), bad_* (400), not_configured (503).","operationId":"billing_checkout_billing_checkout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/billing/portal":{"post":{"summary":"Billing Portal","description":"A Stripe Customer Portal URL. DA headers.\nBody: {\"platform\": ..., \"flow\": \"plan_change\"|null} — plan_change opens on\nthe live subscription's plan picker (Switch to yearly).","operationId":"billing_portal_billing_portal_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/billing/manage":{"get":{"summary":"Billing Manage","description":"The stable manage link Customer.io emails carry (management_url):\n?da=<id>&t=<signature>. Opens a fresh portal session and redirects there,\nso the link never expires and needs no Stripe login.","operationId":"billing_manage_billing_manage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/o/{token}":{"get":{"summary":"Recap Offer Link","description":"A recap email's Keep Pro button (core/recap_emails.py offer_link):\nrecords the offer applied from the email, then sends the person to where\ntheir platform buys it — the App Store's offer code sheet, the Android app\n(a Play offer is bought in the app), or Stripe checkout.","operationId":"recap_offer_link_o__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dove-account/email-prefs":{"get":{"summary":"Da Email Prefs","description":"The weekly recap email's switch, and whether Settings shows it: a paying\nsubscriber in the recap emails test half.","operationId":"da_email_prefs_dove_account_email_prefs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Da Email Prefs Set","description":"Turns the weekly recap email on or off ({\"weekly_recap\": bool}), and\nmirrors it to its Customer.io topic when one is configured.","operationId":"da_email_prefs_set_dove_account_email_prefs_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/usage":{"post":{"summary":"Da Usage","description":"What the app counts for the recap emails: {\"day\": \"YYYY-MM-DD\" (UTC),\n\"summaries_opened\": n}, the thread summaries expanded that day.","operationId":"da_usage_dove_account_usage_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/store-prices":{"post":{"summary":"Da Store Prices","description":"The store prices this device sees ({\"platform\", \"monthly\": {\"amount\",\n\"currency\"}, \"yearly\": {…}}), so a recap email quotes what the person\nwould pay.","operationId":"da_store_prices_dove_account_store_prices_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/recap-emails/run":{"post":{"summary":"Internal Recap Emails Run","description":"One account's recap email now, for QA: {\"dove_account_id\" or \"email\",\n\"kind\", \"dry_run\", \"qa\"}. A dry run returns the payload and sends nothing;\nqa (QA accounts only, core/qa_accounts.py) skips the timing and\neligibility rules. Any other account is sent nothing until\nRECAP_EMAILS_MODE is on (result not_live).","operationId":"internal_recap_emails_run_internal_recap_emails_run_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/billing/done":{"get":{"summary":"Billing Done","description":"Where Checkout and the Portal send Windows and Linux users back: opens\ndove://purchase-success (Checkout's success_url must be http(s)), which\nmakes the app refresh its entitlement, with a link in case the browser\nasks first.","operationId":"billing_done_billing_done_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/scheduled-sends":{"get":{"summary":"Da Scheduled Send List","description":"Every schedule this DA made, plus those of shared mailboxes it has proved\naccess to, changed after `since` (ms, default 0 = all), without EMLs.","operationId":"da_scheduled_send_list_dove_account_scheduled_sends_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Da Scheduled Send Create","description":"Schedule a message. Body: {username, mid, message_id, thread_id?, send_at, eml_base64}.\nThe EML is the fully built message; the bridge sends it as-is at send_at (ms UTC).","operationId":"da_scheduled_send_create_dove_account_scheduled_sends_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/scheduled-sends/{schedule_id}":{"put":{"summary":"Da Scheduled Send Reschedule","description":"Move a schedule and/or replace its message. Body: {send_at, eml_base64?, message_id?, thread_id?}.","operationId":"da_scheduled_send_reschedule_dove_account_scheduled_sends__schedule_id__put","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Da Scheduled Send Cancel","operationId":"da_scheduled_send_cancel_dove_account_scheduled_sends__schedule_id__delete","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dove-account/scheduled-sends/{schedule_id}/send-now":{"post":{"summary":"Da Scheduled Send Now","description":"Pull the send to now. The dispatcher sends; the `sent` socket event confirms.","operationId":"da_scheduled_send_now_dove_account_scheduled_sends__schedule_id__send_now_post","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dove-account/scheduled-sends/{schedule_id}/eml":{"get":{"summary":"Da Scheduled Send Eml","description":"The stored message, so another device can materialise it in its Send Later folder.","operationId":"da_scheduled_send_eml_dove_account_scheduled_sends__schedule_id__eml_get","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dove-account/sync":{"get":{"summary":"Da Sync","description":"Return all changes since the given timestamp.\nQuery param: since (epoch millis, default 0)\nResponse: { main_email, changes: [...] }  — data=null on a change means deleted.","operationId":"da_sync_dove_account_sync_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account":{"delete":{"summary":"Da Delete Account","description":"Permanently delete the entire Dove Account and all its objects.\nThis is irreversible — all devices will be signed out on next sync.","operationId":"da_delete_account_dove_account_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dove-account/main-email":{"put":{"summary":"Da Change Main Email","description":"Change the main email of the Dove Account.\nBody: { object_id }  — object_id of the account object to promote to main.\nReturns 422 if object_id is not a valid account in this DA.\nReturns 403 if the action is forbidden (e.g. deleting the main account).\nReturns 409 if the email is already main of another DA.","operationId":"da_change_main_email_dove_account_main_email_put","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/unread-indicators/get":{"post":{"summary":"Unread Indicators Get","description":"Return focus_feed_seen_at + noise_seen_at for each requested username.\nMissing rows are seeded to \"now\" server-side so the client gets a stable\nstarting point and does not flood dots for historical mail.\n\nAuth: every (username, device_id) pair must be registered in AuthStore —\ni.e. the device has actually logged in to that mail account. This stops\na caller from probing or muting another user's indicators just by\nknowing their email.\n\nBody: { device_id, usernames: [str, ...] }\nResponse: { success, timestamps: { username: { focus_feed_seen_at, noise_seen_at } } }","operationId":"unread_indicators_get_unread_indicators_get_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/unread-indicators/set":{"post":{"summary":"Unread Indicators Set","description":"Upsert focus_feed_seen_at and/or noise_seen_at for a single username.\nEither field may be omitted; only the provided ones are written.\n\nAuth: (username, device_id) must be registered in AuthStore.\n\nBody: { device_id, username, focus_feed_seen_at?, noise_seen_at? }","operationId":"unread_indicators_set_unread_indicators_set_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/account/objects":{"get":{"summary":"Get Account Objects","description":"Fetch a single per-account object by type.\nHeaders: X-Email, X-Device-Id\nQuery params:\n    object_type  (required)\n    since_millis (optional, millis) — omit or 0 for full restore;\n                 pass last known updated_at for incremental fetch (304 if unchanged).\nReturns { \"data\": {...}, \"created_at\": int|null, \"updated_at\": int|null }\nor 304 Not Modified if the type hasn't changed since since_millis.","operationId":"get_account_objects_account_objects_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Upsert Account Object","description":"Upsert a single per-account object and notify all active sessions for\nthis account so they can pull the updated value immediately.\nHeaders: X-Email, X-Device-Id\nBody: { \"object_type\": str, \"data\": dict }","operationId":"upsert_account_object_account_objects_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}}}