{"openapi":"3.1.0","info":{"title":"NudgeLink API","version":"0.1.0"},"paths":{"/health":{"get":{"tags":["health"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/live":{"get":{"tags":["health"],"summary":"Health Live","operationId":"health_live_health_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/deep":{"get":{"tags":["health"],"summary":"Health Deep","operationId":"health_deep_health_deep_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/register":{"post":{"tags":["auth"],"summary":"Register","operationId":"register_api_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/verify-email":{"get":{"tags":["auth"],"summary":"Verify Email","operationId":"verify_email_api_v1_auth_verify_email_get","parameters":[{"name":"token","in":"query","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"}}}}}}},"/api/v1/auth/resend-verification":{"post":{"tags":["auth"],"summary":"Resend Verification","operationId":"resend_verification_api_v1_auth_resend_verification_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/login":{"post":{"tags":["auth"],"summary":"Login","operationId":"login_api_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenPair"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh","operationId":"refresh_api_v1_auth_refresh_post","parameters":[{"name":"nudgelink_refresh","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nudgelink Refresh"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RefreshRequest"},{"type":"null"}],"title":"Req"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenPair"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["auth"],"summary":"Me","operationId":"me_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["auth"],"summary":"Update Me","operationId":"update_me_api_v1_auth_me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","operationId":"logout_api_v1_auth_logout_post","responses":{"204":{"description":"Successful Response"}},"security":[{"HTTPBearer":[]}]}},"/api/v1/auth/forgot-password":{"post":{"tags":["auth"],"summary":"Forgot Password","operationId":"forgot_password_api_v1_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/reset-password":{"post":{"tags":["auth"],"summary":"Reset Password","operationId":"reset_password_api_v1_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/totp/setup":{"post":{"tags":["auth"],"summary":"Totp Setup","description":"Generate a new TOTP secret. Returns provisioning URI for QR code.\nThe secret is stored as *pending* until confirmed with /totp/confirm.","operationId":"totp_setup_api_v1_auth_totp_setup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotpSetupResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/auth/totp/confirm":{"post":{"tags":["auth"],"summary":"Totp Confirm","description":"Confirm 2FA setup by verifying a code from the authenticator app.","operationId":"totp_confirm_api_v1_auth_totp_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotpConfirmRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/auth/totp/disable":{"post":{"tags":["auth"],"summary":"Totp Disable","description":"Disable 2FA - requires a valid current code.","operationId":"totp_disable_api_v1_auth_totp_disable_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotpConfirmRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/onboarding/icp":{"get":{"tags":["onboarding"],"summary":"Get Icp","description":"Return current stored ICP + style profile.","operationId":"get_icp_api_v1_onboarding_icp_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Icp Api V1 Onboarding Icp Get"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["onboarding"],"summary":"Update Icp","description":"Edit the ICP body (summary / criteria / keywords / sample_message) in\nplace — no AI regenerate. Unlike ``approve-icp`` (used at onboarding), this\ndeliberately does NOT touch ``style_profile``, so tweaking the ICP never\nwipes the tone samples the client has taught the system through message\nedits. Structured facets (locations/industries/skills) and calibration\nanchors are preserved untouched.","operationId":"update_icp_api_v1_onboarding_icp_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICPUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICPResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/onboarding/generate-icp":{"post":{"tags":["onboarding"],"summary":"Generate Icp","description":"Claude produces ICP proposal. Client reviews & approves separately.\n\nAccepts a lenient body (see :class:`GenerateICPInput`) and backfills\nany missing/short field from the user's already-saved profile. This\nis what makes Regenerate work after a hard refresh on Step 2 even\nwhen the FE no longer has the business inputs in component state.","operationId":"generate_icp_api_v1_onboarding_generate_icp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateICPInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICPResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/onboarding/angle-samples":{"post":{"tags":["onboarding"],"summary":"Angle Samples","description":"Onboarding v2 (2026-07-28), wizard 2.4: real sample first messages per\ncampaign angle for THIS business — the figma block marked \"добавим позже\".\n\nAccepts the same lenient body as /generate-icp (backfills from the stored\nprofile). Best-effort by contract: any provider failure returns empty\nsamples and the frontend hides the block — a nicety must never 502 the\nwizard.","operationId":"angle_samples_api_v1_onboarding_angle_samples_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateICPInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Angle Samples Api V1 Onboarding Angle Samples Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/onboarding/voice-preview":{"post":{"tags":["onboarding"],"summary":"Voice Preview","description":"Onboarding v2 (2026-07-28), wizard 2.3: hear one message in the voice\njust described, before the campaign exists (figma's live sound preview).\n\nFail-soft by contract, like /angle-samples: any provider failure returns an\nempty preview and the frontend keeps the wizard moving.","operationId":"voice_preview_api_v1_onboarding_voice_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoicePreviewInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Voice Preview Api V1 Onboarding Voice Preview Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/onboarding/approve-icp":{"post":{"tags":["onboarding"],"summary":"Approve Icp","description":"Persist ICP + style_profile to the client.","operationId":"approve_icp_api_v1_onboarding_approve_icp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICPApproveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICPResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/onboarding/keyword-suggestions":{"get":{"tags":["onboarding"],"summary":"List Keyword Suggestions","description":"Pending keyword suggestions for the current client (newest first).\n\n``campaign_id`` narrows to that campaign's suggestions (2026-07-28: the\ncard lives on Campaign → Settings for campaign-first clients). Omitted =\nevery pending suggestion, which is what the legacy Settings → ICP card\nexpects — do not narrow that default or un-flipped clients stop seeing\nrows created before Alembic 047.","operationId":"list_keyword_suggestions_api_v1_onboarding_keyword_suggestions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KeywordSuggestionOut"},"title":"Response List Keyword Suggestions Api V1 Onboarding Keyword Suggestions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/keyword-suggestions/{suggestion_id}":{"post":{"tags":["onboarding"],"summary":"Decide Keyword Suggestion","description":"Accept (merge into icp.keywords, case-insensitive dedup) or reject a\npending suggestion. Returns the resulting ICP either way so the UI can\nrefresh from one response.\n\n2026-07-28: with ``campaign_id`` the merge target is that campaign's\n``icp_override`` — the ICP campaign-first discovery actually searches with.\nWithout it, the account ICP, unchanged for un-flipped clients.","operationId":"decide_keyword_suggestion_api_v1_onboarding_keyword_suggestions__suggestion_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Suggestion Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeywordSuggestionDecision"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ICPResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/extract-voice":{"post":{"tags":["onboarding"],"summary":"Extract Voice","description":"Doc п.5 — learn the client's real voice from their own writing and store\nit as the style_profile, so drafts sound like THEM rather than the\nsynthetic house default (\"Sofia's voice\"). The main lever against every\nclient sounding identical.","operationId":"extract_voice_api_v1_onboarding_extract_voice_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractVoiceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Extract Voice Api V1 Onboarding Extract Voice Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/onboarding/update-business":{"post":{"tags":["onboarding"],"summary":"Update Business","operationId":"update_business_api_v1_onboarding_update_business_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Update Business Api V1 Onboarding Update Business Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/onboarding/wizard/state":{"get":{"tags":["onboarding"],"summary":"Get Wizard State","description":"Return the user's current wizard step.\n\nIf ``Client.onboarding_state`` is NULL (user pre-dates the wizard\nor has never opened it) the response is derived from data shape so\nthe UI can drop them on the right step without a backfill.","operationId":"get_wizard_state_api_v1_onboarding_wizard_state_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WizardStateOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/onboarding/wizard/advance":{"post":{"tags":["onboarding"],"summary":"Advance Wizard","description":"Move the wizard to the requested step.\n\nValidation:\n\n* Step must be in the known vocabulary.\n* Cannot forward-skip more than one step (e.g. business → discover\n  is rejected). ``done`` is always reachable as an explicit dismiss.\n* Going back is allowed (re-edit your ICP).\n\nReturns the new state. 400 on illegal transition.","operationId":"advance_wizard_api_v1_onboarding_wizard_advance_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WizardAdvanceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WizardStateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/onboarding/wizard/skip":{"post":{"tags":["onboarding"],"summary":"Skip Wizard Step","description":"Mark a step as skipped and advance to the next.\n\nLegacy flavour: ``linkedin`` and ``discover``. Campaign-first (v2):\nonly ``connect_linkedin``. The wizard banner on the dashboard will\nkeep nagging until the skipped step is later completed (or the user\nexplicitly dismisses the whole wizard with POST /wizard/advance\nstep=done).","operationId":"skip_wizard_step_api_v1_onboarding_wizard_skip_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WizardSkipRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WizardStateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/leads":{"get":{"tags":["leads"],"summary":"List Leads","operationId":"list_leads_api_v1_leads_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/LeadStatus"},{"type":"null"}],"title":"Status"}},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Id"}},{"name":"in_outreach","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"In Outreach"}},{"name":"invite_outcome","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invite Outcome"}},{"name":"stage","in":"query","required":false,"schema":{"anyOf":[{"enum":["replied","active","paused","completed","stopped","not_started"],"type":"string"},{"type":"null"}],"title":"Stage"}},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"enum":["stage","score","newest"],"type":"string"},{"type":"null"}],"title":"Sort"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["leads"],"summary":"Create Lead","operationId":"create_lead_api_v1_leads_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLeadRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/leads/import":{"post":{"tags":["leads"],"summary":"Import Leads","operationId":"import_leads_api_v1_leads_import_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportLeadsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportLeadsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/leads/bulk-delete":{"post":{"tags":["leads"],"summary":"Bulk Delete Leads","description":"Delete many leads (and their sequences/messages) in one call. Only the\ncaller's own leads are touched; unknown / other-tenant ids are ignored.","operationId":"bulk_delete_leads_api_v1_leads_bulk_delete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteLeadsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteLeadsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/leads/{lead_id}/score":{"post":{"tags":["leads"],"summary":"Score Lead","operationId":"score_lead_api_v1_leads__lead_id__score_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/leads/{lead_id}":{"get":{"tags":["leads"],"summary":"Get Lead","operationId":"get_lead_api_v1_leads__lead_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["leads"],"summary":"Delete Lead","operationId":"delete_lead_api_v1_leads__lead_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["leads"],"summary":"Update Lead","description":"P1-8: edit a lead's display fields (name / title / company / location).\nOnly provided (non-null) fields are changed.","operationId":"update_lead_api_v1_leads__lead_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLeadRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/leads/discover":{"post":{"tags":["leads"],"summary":"Start Discovery","description":"Kick off a discovery run. Synchronous pre-flight checks + Celery\ndispatch. Returns 402 on insufficient credits, 409 if a run is already\nin flight, 400 if pre-conditions aren't met (no ICP / no LinkedIn account).","operationId":"start_discovery_api_v1_leads_discover_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoverRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoverResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/leads/discover/runs/{run_id}/retry":{"post":{"tags":["leads"],"summary":"Retry Discovery","operationId":"retry_discovery_api_v1_leads_discover_runs__run_id__retry_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoverResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/leads/discover/estimate":{"get":{"tags":["leads"],"summary":"Discover Estimate","description":"Authoritative worst-case credit estimate for a discovery run.\n\nQA 2026-06-30 (BUG-2): the frontend used to re-derive this from hardcoded\ncopies of the pool-sizing constants (POOL_SCORE_FACTOR / deep_pool_factor /\nMIN_POOL_SCORE_CAP / deep_max_scored). Those are all env-overridable — prod\nsets ``DISCOVERY_MIN_SCORE_CAP=50`` — so the UI under-quoted the real charge\n(target=5 normal: showed 75, charged 150). This returns the SAME number the\npreflight gate and the actual per-profile billing use, so the label always\nmatches what is charged, regardless of env overrides.","operationId":"discover_estimate_api_v1_leads_discover_estimate_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"target_limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":5,"title":"Target Limit"}},{"name":"deep_search","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Deep Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoverEstimateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/leads/discover/search-parameters":{"get":{"tags":["leads"],"summary":"Search Parameters","description":"Discovery v2 typeahead: resolve a free-text facet value (e.g. \"Berlin\",\n\"Stripe\") to LinkedIn IDs for the structured-search filter form.\n\nProxies the connected account's Unipile ``/linkedin/search/parameters``.\nResults are cached in Redis for 24h (the taxonomy is static). Best-effort:\nreturns ``[]`` (never 5xx) when no usable seat can resolve, so the form shows\n\"no matches\" instead of erroring. Gated by ``feature_structured_search`` — the\nv2 filter UI only calls this when the flag is on.","operationId":"search_parameters_api_v1_leads_discover_search_parameters_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"type","in":"query","required":true,"schema":{"type":"string","description":"Facet: LOCATION|COMPANY|INDUSTRY|SCHOOL|SKILL (or PAST_COMPANY).","title":"Type"},"description":"Facet: LOCATION|COMPANY|INDUSTRY|SCHOOL|SKILL (or PAST_COMPANY)."},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"Free-text typeahead query.","title":"Q"},"description":"Free-text typeahead query."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SearchParamOut"},"title":"Response Search Parameters Api V1 Leads Discover Search Parameters Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/leads/discover/runs":{"get":{"tags":["leads"],"summary":"List Runs","description":"Recent discovery runs for this client, newest first.","operationId":"list_runs_api_v1_leads_discover_runs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RunOut"},"title":"Response List Runs Api V1 Leads Discover Runs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/leads/discover/runs/{run_id}":{"get":{"tags":["leads"],"summary":"Get Run","description":"One run + all its suggestions (newest-first by score). The UI polls\nthis every 3 seconds while ``status == 'running'``.","operationId":"get_run_api_v1_leads_discover_runs__run_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunDetailOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/leads/discover/runs/{run_id}/cancel":{"post":{"tags":["leads"],"summary":"Cancel Run","description":"Cancel an in-flight discovery run (P0-1).\n\nClient-scoped and idempotent. Queued work is revoked and marked cancelled\nimmediately. An active worker observes the cancellation signal, commits\nconfirmed partial results and releases the single-run lock when it exits.\nWhile that worker owns the row, this endpoint can still return ``running``.\nAlready-terminal runs are returned unchanged.","operationId":"cancel_run_api_v1_leads_discover_runs__run_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/leads/suggestions/{suggestion_id}/accept":{"post":{"tags":["leads"],"summary":"Accept Suggestion","description":"Materialise the suggestion into a real ``leads`` row.","operationId":"accept_suggestion_api_v1_leads_suggestions__suggestion_id__accept_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Suggestion Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptSuggestionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/leads/discover/runs/{run_id}/accept-all":{"post":{"tags":["leads"],"summary":"Accept All Suggestions","description":"Materialise every still-pending suggestion of the run into a Lead.\n\nBulk twin of ``accept_suggestion`` (client feedback 2026-07-10: approving\na big run one-by-one is painful). Row semantics match the single-accept\npath exactly: dedup by ``linkedin_url``, campaign inheritance via\n``materialise_lead_from_suggestion``, rejected rows are never resurrected.\nIdempotent — a second call finds no pending rows and no-ops. One audit row\nfor the whole batch.","operationId":"accept_all_suggestions_api_v1_leads_discover_runs__run_id__accept_all_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptAllResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/leads/suggestions/{suggestion_id}/reject":{"post":{"tags":["leads"],"summary":"Reject Suggestion","description":"Mark the suggestion as rejected. Idempotent.","operationId":"reject_suggestion_api_v1_leads_suggestions__suggestion_id__reject_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Suggestion Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/providers/spending":{"get":{"tags":["admin-providers"],"summary":"Admin Spending","operationId":"admin_spending_api_v1_admin_providers_spending_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/providers/attempts":{"get":{"tags":["admin-providers"],"summary":"Attempts","operationId":"attempts_api_v1_admin_providers_attempts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/providers/attempts/{attempt_id}/reconcile":{"post":{"tags":["admin-providers"],"summary":"Reconcile","operationId":"reconcile_api_v1_admin_providers_attempts__attempt_id__reconcile_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Attempt Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconcileRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scout/entities":{"get":{"tags":["scout"],"summary":"List Entities","description":"Review list. ``run_id`` narrows it to what one run found (the page's\ndefault — before 2026-09-23 every tab mixed every campaign's results).","operationId":"list_entities_api_v1_scout_entities_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"view","in":"query","required":false,"schema":{"type":"string","pattern":"^(companies|people|needs_verification)$","default":"companies","title":"View"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoutEntityList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scout/accept":{"post":{"tags":["scout"],"summary":"Accept Entities","description":"Bulk-accept resolved people into Leads. Excludes anything not campaign-ready\nand reports why, so the UI can state \"N skipped\". Companies are never accepted.","operationId":"accept_entities_api_v1_scout_accept_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/scout/entities/dismiss":{"post":{"tags":["scout"],"summary":"Dismiss Entities","description":"Hide wrong finds (or bring them back with ``undo``). A dismissed entity\nstays hidden when a later run finds it again: ``suppressed`` lives on the\ntenant-level entity, which re-discovery reuses.","operationId":"dismiss_entities_api_v1_scout_entities_dismiss_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DismissRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Dismiss Entities Api V1 Scout Entities Dismiss Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/scout/entities/{entity_id}/resolve":{"post":{"tags":["scout"],"summary":"Resolve Entity","description":"\"Add with this LinkedIn URL\" from Check by hand. Free: the customer did\nthe matching (manual lead adds are free too); Scout charges only for people\nit matched itself.","operationId":"resolve_entity_api_v1_scout_entities__entity_id__resolve_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualResolveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualResolveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scout/runs/preview":{"post":{"tags":["scout"],"summary":"Preview Web Run","description":"What a run with this campaign + brief would search for, and what it\nwould reserve. No spend, no run row, no provider call.","operationId":"preview_web_run_api_v1_scout_runs_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoutRunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoutPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/scout/brief/draft":{"post":{"tags":["scout"],"summary":"Draft Brief","description":"\"Describe it in words\": a sentence -> a brief the page shows for review.\nNever starts a run. Free for the customer; one small Haiku call.","operationId":"draft_brief_api_v1_scout_brief_draft_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefDraftRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoutBrief"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/scout/capabilities":{"get":{"tags":["scout"],"summary":"Capabilities","operationId":"capabilities_api_v1_scout_capabilities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Capabilities Api V1 Scout Capabilities Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/scout/runs":{"post":{"tags":["scout"],"summary":"Start Web Run","operationId":"start_web_run_api_v1_scout_runs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoutRunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartWebRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/scout/runs/latest":{"get":{"tags":["scout"],"summary":"Latest Web Run","description":"The newest Scout run with its stage stats, plus the tab counts.\n\n2026-09-23: the page had no way to show a run at all — a run that found\nnobody ended as \"Nothing here yet.\" with no hint whether the search\nreturned nothing, pages were unreadable, or people were found but never\nmatched to LinkedIn. This is what the page's run panel reads.","operationId":"latest_web_run_api_v1_scout_runs_latest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoutRunStatus"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/scout/runs/{run_id}/retry":{"post":{"tags":["scout"],"summary":"Retry Web Run","operationId":"retry_web_run_api_v1_scout_runs__run_id__retry_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartWebRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scout/runs/{run_id}/cancel":{"post":{"tags":["scout"],"summary":"Cancel Web Run","operationId":"cancel_web_run_api_v1_scout_runs__run_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel Web Run Api V1 Scout Runs  Run Id  Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounts/{account_id}":{"patch":{"tags":["accounts"],"summary":"Update Account","description":"Edit account settings (timezone, invite pace, sending window). Scoped\nto the caller's own accounts.\n\nThe timezone and window decide WHEN automatic actions go out; the\ndaily-cap day boundary stays UTC (locked decision #7).","operationId":"update_account_api_v1_accounts__account_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkedInAccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["accounts"],"summary":"Delete Account","description":"2026-06-12 (#43): remove a connected LinkedIn account.\n\nOrder of operations (safety-first):\n  1. Ownership check — 404 for anyone else's account (no existence leak).\n  2. Pause every non-terminal sequence routed through this account, with\n     an explicit pause_reason so the leads page explains itself. The FK is\n     ``SET NULL`` on delete, so without this step live sequences would\n     silently lose their sending seat and stall with no explanation.\n  3. Best-effort disconnect of the seat at Unipile (so the LinkedIn\n     session is actually severed, not just hidden from our UI). A\n     provider failure does NOT block the local delete — the user asked\n     for the account to be gone; we log and continue.\n  4. Delete the row.","operationId":"delete_account_api_v1_accounts__account_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounts":{"get":{"tags":["accounts"],"summary":"List Accounts","operationId":"list_accounts_api_v1_accounts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/LinkedInAccountOut"},"type":"array","title":"Response List Accounts Api V1 Accounts Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["accounts"],"summary":"Connect Account","description":"Connect a LinkedIn account via the manual-paste fallback flow.\n\nMost customers go through the one-click hosted-auth flow (``start-connect``\nabove + the Unipile webhook). This endpoint is the escape hatch for:\n  - Tim manually attaching an account he created in the Unipile dashboard\n  - Pilot customers debugging issues where the hosted-auth webhook\n    didn't fire\n  - Internal automated tests\n\nFlow:\n  1. Reject duplicates: if a row with the same external_account_id already\n     exists for this client, return 409 (avoids accidentally creating\n     double-billing rows on retry).\n  2. Probe Unipile with check_account_health. We allow ``warming`` /\n     ``requires_action`` / unknown statuses through (just create the row\n     in ``warming`` state — the P1.3 poller will reconcile). Only an\n     actual network/auth error blocks creation.\n  3. Always release the per-call adapter so we never leak the httpx\n     connection pool — every call to ``get_linkedin_adapter()`` returns\n     a fresh instance, so aclose() is mandatory.","operationId":"connect_account_api_v1_accounts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectLinkedInRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkedInAccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/accounts/start-connect":{"post":{"tags":["accounts"],"summary":"Start Connect","description":"P1.1 — kick off self-serve LinkedIn connect via Unipile hosted auth.\n\nReturns a one-time URL the customer should be redirected to. They log\ninto LinkedIn on Unipile-hosted pages (Unipile handles credential\ncapture, 2FA, proxy assignment). On success Unipile webhooks our\n``POST /api/v1/webhooks/unipile/account-connected`` handler with the\nnew ``account_id``; we then create the LinkedInAccount row.\n\nThe customer never sees Tim, Tim never touches the credentials.","operationId":"start_connect_api_v1_accounts_start_connect_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/StartConnectRequest"},{"type":"null"}],"title":"Req"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartConnectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/accounts/{account_id}/pause":{"post":{"tags":["accounts"],"summary":"Pause Account","operationId":"pause_account_api_v1_accounts__account_id__pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Pause Account Api V1 Accounts  Account Id  Pause Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounts/{account_id}/resume":{"post":{"tags":["accounts"],"summary":"Resume Account","operationId":"resume_account_api_v1_accounts__account_id__resume_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Resume Account Api V1 Accounts  Account Id  Resume Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns":{"get":{"tags":["campaigns"],"summary":"List Campaigns","operationId":"list_campaigns_api_v1_campaigns_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CampaignOut"},"title":"Response List Campaigns Api V1 Campaigns Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["campaigns"],"summary":"Create Campaign","operationId":"create_campaign_api_v1_campaigns_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}":{"get":{"tags":["campaigns"],"summary":"Get Campaign","operationId":"get_campaign_api_v1_campaigns__campaign_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["campaigns"],"summary":"Update Campaign","operationId":"update_campaign_api_v1_campaigns__campaign_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/replies.csv":{"get":{"tags":["campaigns"],"summary":"Export Replies","description":"Who replied in this campaign: name, LinkedIn link, sentiment, last reply.","operationId":"export_replies_api_v1_campaigns__campaign_id__replies_csv_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/assign-leads":{"post":{"tags":["campaigns"],"summary":"Assign Leads","description":"Bulk-assign the client's leads to this campaign. Leads already in\nanother campaign are moved (one campaign per lead by design).","operationId":"assign_leads_api_v1_campaigns__campaign_id__assign_leads_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignLeadsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignLeadsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/unassign-leads":{"post":{"tags":["campaigns"],"summary":"Unassign Leads","operationId":"unassign_leads_api_v1_campaigns__campaign_id__unassign_leads_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignLeadsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignLeadsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/start-preview":{"get":{"tags":["campaigns"],"summary":"Start Preview","operationId":"start_preview_api_v1_campaigns__campaign_id__start_preview_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/start":{"post":{"tags":["campaigns"],"summary":"Start Campaign","description":"Start outreach sequences for every campaign lead that doesn't have one.\n\nReuses the sequence-start machinery (api/sequences.start_sequences_for_leads)\nso mode selection, account pinning, and lead status transitions stay in one\nplace. Paused campaigns are resumed implicitly on start (matches the UI's\nsingle Start button semantics).","operationId":"start_campaign_api_v1_campaigns__campaign_id__start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartCampaignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/pause":{"post":{"tags":["campaigns"],"summary":"Pause Campaign","description":"Pause the campaign and every ACTIVE sequence of its leads. Marked with\na dedicated pause_reason so resume only touches what pause did.","operationId":"pause_campaign_api_v1_campaigns__campaign_id__pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PauseCampaignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/resume":{"post":{"tags":["campaigns"],"summary":"Resume Campaign","description":"Resume the campaign: un-pause ONLY the sequences the campaign pause\nitself paused (pause_reason marker) — a lead the client paused manually\nstays paused.","operationId":"resume_campaign_api_v1_campaigns__campaign_id__resume_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeCampaignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/activation/start":{"post":{"tags":["activation"],"summary":"Activation Start","operationId":"activation_start_api_v1_activation_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivationStartRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivationStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/activation/checklist":{"get":{"tags":["activation"],"summary":"Getting Started Checklist","operationId":"getting_started_checklist_api_v1_activation_checklist_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChecklistOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/sequences":{"get":{"tags":["sequences"],"summary":"List Sequences","description":"Return all sequences for the current user.","operationId":"list_sequences_api_v1_sequences_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SequenceOut"},"type":"array","title":"Response List Sequences Api V1 Sequences Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["sequences"],"summary":"Start Sequence","operationId":"start_sequence_api_v1_sequences_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSequenceRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SequenceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/sequences/bulk-start":{"post":{"tags":["sequences"],"summary":"Bulk Start Sequences","description":"Start outreach for exactly the named leads that don't have a sequence\nyet. Auto-picks the best available LinkedIn account.\n\nAudit 2026-09-29 §2: this used to take no body and start EVERY lead in the\naccount without a sequence, while the leads page counted only the new\nleads in the current filter — \"Start all (1)\" on campaign A could start\ncampaign B's ten too. The page now sends the leads it counted; ids that are\nnot the caller's, or already in outreach, are ignored.","operationId":"bulk_start_sequences_api_v1_sequences_bulk_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkStartRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SequenceOut"},"type":"array","title":"Response Bulk Start Sequences Api V1 Sequences Bulk Start Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/sequences/{sequence_id}":{"get":{"tags":["sequences"],"summary":"Get Sequence","operationId":"get_sequence_api_v1_sequences__sequence_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sequence_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sequence Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SequenceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sequences/{sequence_id}/pause":{"post":{"tags":["sequences"],"summary":"Pause Sequence","operationId":"pause_sequence_api_v1_sequences__sequence_id__pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sequence_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sequence Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SequenceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sequences/{sequence_id}/resume":{"post":{"tags":["sequences"],"summary":"Resume Sequence","operationId":"resume_sequence_api_v1_sequences__sequence_id__resume_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sequence_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sequence Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SequenceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sequences/{sequence_id}/stop":{"post":{"tags":["sequences"],"summary":"Stop Sequence","operationId":"stop_sequence_api_v1_sequences__sequence_id__stop_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sequence_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sequence Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SequenceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sequences/{sequence_id}/trigger":{"post":{"tags":["sequences"],"summary":"Trigger Sequence","description":"Manually advance a sequence one step — runs inline without Celery.\nUseful for demo / testing when no worker is deployed.","operationId":"trigger_sequence_api_v1_sequences__sequence_id__trigger_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sequence_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sequence Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trigger Sequence Api V1 Sequences  Sequence Id  Trigger Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sequences/{sequence_id}/skip-step":{"post":{"tags":["sequences"],"summary":"Skip Step","description":"Skip the current warmup step without performing it (P0-4 / F-6).\n\nAdvances ``current_step`` to the next step and re-arms it as due now, with\nno LinkedIn action and no credit charge. Only the optional warmup steps\n(view / like / comment) are skippable — real outreach steps must run.","operationId":"skip_step_api_v1_sequences__sequence_id__skip_step_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sequence_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sequence Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SequenceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/messages/preview-queue":{"get":{"tags":["messages"],"summary":"Preview Queue","operationId":"preview_queue_api_v1_messages_preview_queue_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewQueueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/messages/preview-queue/mark-seen":{"post":{"tags":["messages"],"summary":"Mark Preview Queue Seen","description":"Bump the Preview-queue read cursor to now.\n\nIdempotent. Called by the frontend a few seconds after the page has\nrendered (debounced) — not on every 10s auto-refresh poll — so the \"new\"\nbadge reflects messages the client hasn't actually had a chance to see\nyet, the same way ``POST /inbox/conversations/{lead_id}/mark-read`` works\nfor the inbox tab.","operationId":"mark_preview_queue_seen_api_v1_messages_preview_queue_mark_seen_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkPreviewQueueSeenResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/messages/voice-metrics":{"get":{"tags":["messages"],"summary":"Voice Metrics","description":"Doc п.1 — positive-reply rate sliced by voice source.\n\nThis is the metric the voice was previously tuned without. Heuristic: a\nsequence's reply classification is attributed to every voice-tagged\noutbound message in that sequence — directional, not exact (a sequence has\nseveral touches), but enough to tell whether a voice moves replies.\nNULL-voice / legacy rows are excluded.","operationId":"voice_metrics_api_v1_messages_voice_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Voice Metrics Api V1 Messages Voice Metrics Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/messages/sequence/{sequence_id}":{"get":{"tags":["messages"],"summary":"List By Sequence","operationId":"list_by_sequence_api_v1_messages_sequence__sequence_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sequence_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sequence Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MessageOut"},"title":"Response List By Sequence Api V1 Messages Sequence  Sequence Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/messages/{message_id}/approve":{"post":{"tags":["messages"],"summary":"Approve Message","operationId":"approve_message_api_v1_messages__message_id__approve_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/messages/{message_id}/reject":{"post":{"tags":["messages"],"summary":"Reject Message","operationId":"reject_message_api_v1_messages__message_id__reject_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/conversations":{"get":{"tags":["inbox"],"summary":"List Conversations","description":"List conversations for the current client.\n\nA conversation = one lead with at least one INBOUND message. Sorted\nby last-message timestamp, newest first.\n\nA6 unread semantics:\n  * ``unread_total`` is GLOBAL (all conversations, not just this page).\n  * ``unread_only=true`` filters in SQL BEFORE pagination — pages can\n    no longer come back empty while unread conversations exist deeper.\n  * ``total`` = all conversations normally; = unread conversations when\n    ``unread_only`` is set.\nImplementation: one query pulls every inbound (lead_id, created_at) for\nthe client, and the per-lead cursor comparison happens in Python. Exact,\nsingle round-trip, and fine at pilot scale (inbound volume is small); at\n~thousands of inbound rows move the cursor map to a real table and do the\nanti-join in SQL (see plan A6 \"real fix\").","operationId":"list_conversations_api_v1_inbox_conversations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"unread_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unread Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxConversationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/conversations/{lead_id}":{"get":{"tags":["inbox"],"summary":"Get Conversation","description":"Full message thread for a lead.\n\nDoes NOT mark the conversation as read - that's a separate POST\nso refreshing the page doesn't silently swallow unread state. The\nUI calls /mark-read explicitly on user interaction.","operationId":"get_conversation_api_v1_inbox_conversations__lead_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxThreadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/conversations/{lead_id}/mark-read":{"post":{"tags":["inbox"],"summary":"Mark Conversation Read","description":"Set the inbox read cursor for ``lead_id`` to ``now``.\n\nIdempotent. Returns the new cursor + zero unread.","operationId":"mark_conversation_read_api_v1_inbox_conversations__lead_id__mark_read_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkReadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/conversations/{lead_id}/reply":{"post":{"tags":["inbox"],"summary":"Reply To Conversation","description":"Send a manual reply via the LinkedIn adapter.\n\nThe outbound Message row is inserted regardless of adapter\nsuccess - if Unipile errors, ``sent_at`` stays NULL so the UI\ncan show \"failed to send\" and the user can retry.","operationId":"reply_to_conversation_api_v1_inbox_conversations__lead_id__reply_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxMessageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/summary":{"get":{"tags":["billing"],"summary":"Summary","operationId":"summary_api_v1_billing_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSummary"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/billing/credit-status":{"get":{"tags":["billing"],"summary":"Credit Status","operationId":"credit_status_api_v1_billing_credit_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditStatusOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/billing/credit-history":{"get":{"tags":["billing"],"summary":"Credit History","description":"Every credit spent, returned or added, newest first (Yarik 2026-10-03:\nBilling showed only the balance, so a Scout charge could not be told apart\nfrom outreach spending — or from a bug). Read from the ledger rows that\ndeduct_credits / refund_credits / admin grants already write.","operationId":"credit_history_api_v1_billing_credit_history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Before"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Before Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditHistoryOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/start":{"post":{"tags":["billing"],"summary":"Start","operationId":"start_api_v1_billing_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSubscriptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/billing/checkout":{"post":{"tags":["billing"],"summary":"Checkout","description":"Create a Stripe Checkout Session for the chosen plan and return its\nhosted ``url``. The frontend redirects the browser to it. The subscription\nis only persisted once Stripe fires ``checkout.session.completed`` to the\nwebhook below — we never trust the browser redirect alone.","operationId":"checkout_api_v1_billing_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSubscriptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Checkout Api V1 Billing Checkout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/billing/portal":{"post":{"tags":["billing"],"summary":"Portal","description":"Create a Stripe Billing Portal session and return its hosted ``url`` so\nthe client can update their card, download invoices, switch plan, or cancel.\n\nIn STRIPE_MODE=mock there's no portal — we return the billing page URL so the\ndev/test flow still resolves. Real mode requires the Billing Portal to be\nconfigured once in the Stripe dashboard.","operationId":"portal_api_v1_billing_portal_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Portal Api V1 Billing Portal Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/billing/webhook":{"post":{"tags":["billing"],"summary":"Webhook","description":"Verified, transactional ledger processing. Failed writes are retried by Stripe.\n\nInvoice payment owns credits and revenue. Checkout completion alone does\nnot prove payment (delayed payment methods can complete before settlement).\nA client row lock serializes different events for the same customer; the\nunique event id handles retries without hiding unrelated database errors.","operationId":"webhook_api_v1_billing_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Webhook Api V1 Billing Webhook Post"}}}}}}},"/api/v1/events/stream":{"get":{"tags":["events"],"summary":"Stream","operationId":"stream_api_v1_events_stream_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/events/unipile-webhook":{"post":{"tags":["events"],"summary":"Unipile Webhook","description":"Receive LinkedIn inbound message notifications from Unipile.\nIn dev the MockLinkedInAdapter drains its inbox via polling, not webhooks;\nthis handler is for production.","operationId":"unipile_webhook_api_v1_events_unipile_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Unipile Webhook Api V1 Events Unipile Webhook Post"}}}}}}},"/api/v1/events/attribution":{"post":{"tags":["events"],"summary":"Record Attribution","description":"First touch wins: an account that already has a source keeps it, and\nonly a new account records one — an old customer browsing the site later\nis not a signup source.","operationId":"record_attribution_api_v1_events_attribution_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributionIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Record Attribution Api V1 Events Attribution Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/events/activation":{"post":{"tags":["events"],"summary":"Capture Activation Event","description":"Record a single activation product-event for the signed-in client.\n\nUnknown ``event_type`` is accepted-but-ignored (returns ``recorded=False``)\nso a frontend that adds a new event never 4xx-errors a fire-and-forget\nbeacon; only allow-listed types are persisted.","operationId":"capture_activation_event_api_v1_events_activation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivationEventIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Capture Activation Event Api V1 Events Activation Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/dashboard/kpi":{"get":{"tags":["dashboard"],"summary":"Kpi","operationId":"kpi_api_v1_dashboard_kpi_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardKPI"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/dashboard/stats/monthly":{"get":{"tags":["dashboard"],"summary":"Stats Monthly","description":"Per-month invite/accept breakdown for the current client. Scoped to the\ncaller — same client-scoping as ``/kpi`` — so it never leaks another\nclient's numbers.","operationId":"stats_monthly_api_v1_dashboard_stats_monthly_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"months","in":"query","required":false,"schema":{"type":"integer","maximum":24,"minimum":1,"default":6,"title":"Months"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonthlyStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/dashboard/activity":{"get":{"tags":["dashboard"],"summary":"Activity","description":"Real, merged, time-descending activity feed for the overview page.\n\nSources (each capped at ``limit`` before the merge so no single stream can\nstarve the others): outbound sends, inbound replies, finished discovery\nruns, and account lifecycle events (connected / paused-by-system /\nrequires-action). The union is re-sorted by timestamp and sliced to\n``limit``. Replaces the old static/fake Activity panel.","operationId":"activity_api_v1_dashboard_activity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ActivityItem"},"title":"Response Activity Api V1 Dashboard Activity Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/me/notifications":{"get":{"tags":["me"],"summary":"Get Notifications","operationId":"get_notifications_api_v1_me_notifications_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPrefs"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["me"],"summary":"Update Notifications","description":"Update notification preferences. Merges onto the existing JSON so keys we\ndon't model here (e.g. a legacy ``in_app`` flag) are preserved.","operationId":"update_notifications_api_v1_me_notifications_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPrefs"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPrefs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/me/export":{"get":{"tags":["me"],"summary":"Export My Data","operationId":"export_my_data_api_v1_me_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/clients/{client_id}/export":{"get":{"tags":["me"],"summary":"Export Client Data","description":"Support export for a data request, including a disabled account.","operationId":"export_client_data_api_v1_admin_clients__client_id__export_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/me/erase/options":{"get":{"tags":["account erasure"],"summary":"Erasure Options","operationId":"erasure_options_api_v1_me_erase_options_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Erasure Options Api V1 Me Erase Options Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/me/erase":{"post":{"tags":["account erasure"],"summary":"Erase Account","operationId":"erase_account_api_v1_me_erase_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EraseRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Erase Account Api V1 Me Erase Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/me/erase/cancel":{"post":{"tags":["account erasure"],"summary":"Cancel Account Erasure","operationId":"cancel_account_erasure_api_v1_me_erase_cancel_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Cancel Account Erasure Api V1 Me Erase Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/erase":{"get":{"tags":["account erasure"],"summary":"Admin Erasure Status","operationId":"admin_erasure_status_api_v1_admin_clients__client_id__erase_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Erasure Status Api V1 Admin Clients  Client Id  Erase Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["account erasure"],"summary":"Admin Erase Account","operationId":"admin_erase_account_api_v1_admin_clients__client_id__erase_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminEraseRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Erase Account Api V1 Admin Clients  Client Id  Erase Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/erase/cancel":{"post":{"tags":["account erasure"],"summary":"Admin Cancel Erasure","operationId":"admin_cancel_erasure_api_v1_admin_clients__client_id__erase_cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Cancel Erasure Api V1 Admin Clients  Client Id  Erase Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/me/erase/reauth/google":{"post":{"tags":["account erasure"],"summary":"Google Reauth","operationId":"google_reauth_api_v1_me_erase_reauth_google_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Google Reauth Api V1 Me Erase Reauth Google Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/overview":{"get":{"tags":["admin"],"summary":"Admin Overview","description":"Operator landing page: headline KPIs + the \"needs attention\" queue.\n\nPaying subscriptions = clients with a Stripe sub (comped/pilot excluded, see\nthe billing-overview note). \"Out of credits\" = on a plan but balance <= 0\n(stalled or in overage).","operationId":"admin_overview_api_v1_admin_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOverview"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/clients":{"get":{"tags":["admin"],"summary":"Admin List Clients","description":"Paged client list with optional filters. Returns ``total`` so the UI\ncan render a proper paginator.","operationId":"admin_list_clients_api_v1_admin_clients_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"plan","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionPlan"},{"type":"null"}],"description":"Filter by subscription_plan","title":"Plan"},"description":"Filter by subscription_plan"},{"name":"guarantee","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/GuaranteeStatus"},{"type":"null"}],"description":"Filter by guarantee_status","title":"Guarantee"},"description":"Filter by guarantee_status"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Substring search on email/company_name","title":"Q"},"description":"Substring search on email/company_name"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminClientList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}":{"get":{"tags":["admin"],"summary":"Admin Client Detail","description":"Everything an admin needs in one round-trip for the client-detail page.\n\nReturns 404 if the client doesn't exist.","operationId":"admin_client_detail_api_v1_admin_clients__client_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminClientDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/messages":{"get":{"tags":["admin"],"summary":"Admin List Messages","description":"Cross-client message viewer (newest first). Join goes Message → Sequence\n→ Client + Lead so we can show the client's email and the lead's name. All\nfilters are optional and AND together.","operationId":"admin_list_messages_api_v1_admin_messages_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"client_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter to one client","title":"Client Id"},"description":"Filter to one client"},{"name":"step","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/OutreachStep"},{"type":"null"}],"title":"Step"}},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/MessageChannel"},{"type":"null"}],"title":"Channel"}},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/MessageDirection"},{"type":"null"}],"title":"Direction"}},{"name":"classification","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/MessageClassification"},{"type":"null"}],"title":"Classification"}},{"name":"preview_status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/MessagePreviewStatus"},{"type":"null"}],"title":"Preview Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminMessageRow"},"title":"Response Admin List Messages Api V1 Admin Messages Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/billing/overview":{"get":{"tags":["admin"],"summary":"Admin Billing Overview","operationId":"admin_billing_overview_api_v1_admin_billing_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingOverview"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/workflows/summary":{"get":{"tags":["admin"],"summary":"Admin Workflow Summary","operationId":"admin_workflow_summary_api_v1_admin_workflows_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowSummary"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/workflows/stalled":{"get":{"tags":["admin"],"summary":"Admin Workflows Stalled","description":"Active sequences whose ``next_action_at`` is more than 24 hours in the\npast — these are stuck and won't self-resolve. The admin should\ninvestigate (likely Celery worker outage) or stop them outright.","operationId":"admin_workflows_stalled_api_v1_admin_workflows_stalled_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRow"},"title":"Response Admin Workflows Stalled Api V1 Admin Workflows Stalled Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/workflows/active":{"get":{"tags":["admin"],"summary":"Admin Workflows Active","description":"All active sequences (paged). For the operator's drill-down.","operationId":"admin_workflows_active_api_v1_admin_workflows_active_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRow"},"title":"Response Admin Workflows Active Api V1 Admin Workflows Active Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/workflows/paused":{"get":{"tags":["admin"],"summary":"Admin Workflows Paused","description":"Paused sequences (paged) — the resume target. ``pause_reason`` shows why\neach was paused (admin hold, comp revoked, …).","operationId":"admin_workflows_paused_api_v1_admin_workflows_paused_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRow"},"title":"Response Admin Workflows Paused Api V1 Admin Workflows Paused Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/linkedin/health":{"get":{"tags":["admin"],"summary":"Admin Linkedin Health","operationId":"admin_linkedin_health_api_v1_admin_linkedin_health_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_ok","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Ok"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountHealthRow"},"title":"Response Admin Linkedin Health Api V1 Admin Linkedin Health Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/ai/costs":{"get":{"tags":["admin"],"summary":"Admin Ai Costs","operationId":"admin_ai_costs_api_v1_admin_ai_costs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}},{"name":"client_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AIUsageSummary"},"title":"Response Admin Ai Costs Api V1 Admin Ai Costs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/ai/cache-efficiency":{"get":{"tags":["admin"],"summary":"Admin Ai Cache Efficiency","operationId":"admin_ai_cache_efficiency_api_v1_admin_ai_cache_efficiency_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AICacheEfficiencyRow"},"title":"Response Admin Ai Cache Efficiency Api V1 Admin Ai Cache Efficiency Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/stats":{"get":{"tags":["admin"],"summary":"Admin Stats","description":"Daily trends (signups, revenue, refunds, AI cost) + window totals with\ngross margin, plus a pilot→paid conversion proxy (started a pilot AND now\nhas a Stripe sub).","operationId":"admin_stats_api_v1_admin_stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":7,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/stats/clients":{"get":{"tags":["admin"],"summary":"Admin Stats Clients","description":"Per-client revenue vs AI cost vs comped credits → gross margin, over the\nwindow. Sorted server-side (default: margin desc). Two grouped scans\n(BillingEvent, AIUsageLog) joined in memory — no per-client N+1.","operationId":"admin_stats_clients_api_v1_admin_stats_clients_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":7,"default":30,"title":"Days"}},{"name":"sort","in":"query","required":false,"schema":{"enum":["margin","revenue","ai_cost"],"type":"string","default":"margin","title":"Sort"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClientEconomicsRow"},"title":"Response Admin Stats Clients Api V1 Admin Stats Clients Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/audit":{"get":{"tags":["admin"],"summary":"Admin Audit Log","operationId":"admin_audit_log_api_v1_admin_audit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"}},{"name":"actor_role","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Role"}},{"name":"client_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Client Id"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AuditRow"},"title":"Response Admin Audit Log Api V1 Admin Audit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/system/killswitch":{"get":{"tags":["admin"],"summary":"Admin Get Killswitch","description":"Current state of the global outreach kill-switch (router gates admin).","operationId":"admin_get_killswitch_api_v1_admin_system_killswitch_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KillSwitchResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["admin"],"summary":"Admin Set Killswitch","description":"Toggle the global outreach kill-switch. ON ⇒ the engine stops dispatching\nnew outreach system-wide (sequences stay active, resume when cleared).\nAudit-logged. 502 if Redis is unreachable so a failed safety toggle isn't\nsilently swallowed.","operationId":"admin_set_killswitch_api_v1_admin_system_killswitch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KillSwitchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KillSwitchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/system/health":{"get":{"tags":["admin"],"summary":"Admin System Health","operationId":"admin_system_health_api_v1_admin_system_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemHealth"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/system/embeddings-check":{"post":{"tags":["admin"],"summary":"Admin Embeddings Check","description":"One live OpenAI embeddings call with a fixed word (no customer data):\nis the key present and accepted, is the flag on, is the dimension right.","operationId":"admin_embeddings_check_api_v1_admin_system_embeddings_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Embeddings Check Api V1 Admin System Embeddings Check Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/voice/outcomes":{"get":{"tags":["admin"],"summary":"Admin Voice Outcomes","description":"Voice-perfection doc §7: cross-client positive-reply-rate sliced by\n``voice_source`` (+ ``voice_version``). This is the number that proves or\ndisproves that the personal client voice lifts replies over the house\ndefault — without it, voice tuning is vibes. Read-only aggregate over all\ntagged outbound messages; also returns the mean advisory §11 ai_score per\nvoice source so System-health can trend 'how bot-like are we'.","operationId":"admin_voice_outcomes_api_v1_admin_voice_outcomes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Voice Outcomes Api V1 Admin Voice Outcomes Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/sequences/{sequence_id}/stop":{"post":{"tags":["admin"],"summary":"Admin Stop Sequence","description":"Force-stop a sequence. Takes ``SELECT ... FOR UPDATE`` to avoid\nracing the Celery worker between read and write.","operationId":"admin_stop_sequence_api_v1_admin_sequences__sequence_id__stop_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sequence_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sequence Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopSequenceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopSequenceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/sequences/{sequence_id}/transition":{"post":{"tags":["admin"],"summary":"Admin Transition Sequence","description":"Pause / resume / retry a sequence. Takes ``SELECT ... FOR UPDATE`` to\navoid racing the Celery worker. Transitions are validated (only an active\nsequence can be paused/retried; only a paused one resumed) and each is\naudited as ``admin.sequence.<action>``.","operationId":"admin_transition_sequence_api_v1_admin_sequences__sequence_id__transition_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sequence_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sequence Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SequenceTransitionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SequenceTransitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/refresh-calibration-anchors":{"post":{"tags":["admin"],"summary":"Admin Refresh Calibration Anchors","description":"§2.3c (learning loop): rebuild this client's ICP calibration anchors from\ntheir real accept/reply/reject decisions, so scoring calibrates to who they\nactually want. Gated by ``feature_calibration_learning`` (makes a Claude call\n+ overwrites the generated anchors). Returns what it did (or why it didn't:\nno ICP / not enough decisions / no anchors produced).","operationId":"admin_refresh_calibration_anchors_api_v1_admin_clients__client_id__refresh_calibration_anchors_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshAnchorsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/credits/grant":{"post":{"tags":["admin"],"summary":"Admin Grant Credits","description":"Grant N credits to a client and log a BillingEvent + AuditLog row.\n\nIdempotency: if ``Idempotency-Key`` header is present and a prior grant\nexists with the same key for this client, return the prior result\nwithout re-applying. Without an idempotency key, double-clicks WILL\ndouble-grant — the UI must always send one.","operationId":"admin_grant_credits_api_v1_admin_clients__client_id__credits_grant_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantCreditsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantCreditsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/credits/set":{"post":{"tags":["admin"],"summary":"Admin Set Credits","description":"Set ``credits_balance`` to an exact value (corrections). Records the signed\ndelta as an ``admin_grant`` BillingEvent + audit row. Idempotent on\n``Idempotency-Key``.","operationId":"admin_set_credits_api_v1_admin_clients__client_id__credits_set_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetCreditsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetCreditsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/pilot/extend":{"post":{"tags":["admin"],"summary":"Admin Extend Pilot","description":"Set a new pilot expiry (extend or shorten). Only valid for clients whose\n``guarantee_status`` is ``pilot``; the new expiry must be in the future.","operationId":"admin_extend_pilot_api_v1_admin_clients__client_id__pilot_extend_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtendPilotRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtendPilotResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/grant-pilot":{"post":{"tags":["admin"],"summary":"Admin Grant Pilot","description":"Grant a free pilot plan to a client (no Stripe charge).\n\nSets ``subscription_plan`` + ``guarantee_status=pilot`` + ``pilot_start_at`` +\n``pilot_expires_at`` (= now + ``free_days``), refills the plan's monthly\ncredit allowance, and logs an ``admin_grant`` BillingEvent (amount = the\ncredit count granted, so the admin overview's granted-credits total reflects\nit) plus an AuditLog row. Idempotent on ``Idempotency-Key``.","operationId":"admin_grant_pilot_api_v1_admin_clients__client_id__grant_pilot_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantPilotRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantPilotResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/campaigns":{"get":{"tags":["admin"],"summary":"Admin Client Campaigns","description":"Read-only list of ALL the client's campaigns (incl. archived) for QA.","operationId":"admin_client_campaigns_api_v1_admin_clients__client_id__campaigns_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminCampaignRow"},"title":"Response Admin Client Campaigns Api V1 Admin Clients  Client Id  Campaigns Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/grant-preview":{"get":{"tags":["admin"],"summary":"Admin Grant Preview","description":"Compute the before→after state + warnings for a proposed grant so the\nconfirmation UI can show consequences before anything is written. Performs\nno mutation. ``amount`` is required for ``kind=credits``; ``plan`` for\n``kind=pilot|plan``.","operationId":"admin_grant_preview_api_v1_admin_clients__client_id__grant_preview_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}},{"name":"kind","in":"query","required":true,"schema":{"enum":["credits","pilot","plan"],"type":"string","title":"Kind"}},{"name":"amount","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":100000,"exclusiveMinimum":0},{"type":"null"}],"title":"Amount"}},{"name":"plan","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionPlan"},{"type":"null"}],"title":"Plan"}},{"name":"free_days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"exclusiveMinimum":0,"default":30,"title":"Free Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantPreview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/grant-plan":{"post":{"tags":["admin"],"summary":"Admin Grant Plan","description":"Grant a client any plan for free, with no expiry (comped plan).\n\nSets ``subscription_plan`` + ``plan_comped=True`` + ``guarantee_status=active``,\nclears any pilot expiry (a comp supersedes a time-boxed pilot), starts a\nfresh billing cycle, and refills the plan's monthly credits. Logged as an\n``admin_grant`` BillingEvent (amount = credit COUNT, not dollars) + audit\nrow. Idempotent on ``Idempotency-Key``.","operationId":"admin_grant_plan_api_v1_admin_clients__client_id__grant_plan_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantPlanRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantPlanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/revoke-plan":{"post":{"tags":["admin"],"summary":"Admin Revoke Comped Plan","description":"Revoke a comped plan. Revoked comps lose their plan (Ilya, 2026-10-13,\nMONEY-11): ``subscription_plan`` and ``plan_comped`` are cleared, the way a\ncancelled Stripe subscription clears the plan. Entitlements drop to \"no\nplan\" (email outreach, HubSpot and Scout pause; MCP stays), Billing shows\nthe account without a plan, and the monthly comp refill stops. The comp's\ncredits are drained to 0, as before (a revoke ends free usage). Active\nsequences pause with\n``comp_revoked`` (the client can resume them; a new comp or a paid\ncheckout resumes them) and ``guarantee_status`` flips to inactive.\n\nClearing the plan used to be avoided because \"no plan\" meant \"internal\ndemo, exempt from credit checks\". That branch is gone: every account is\ncredit-governed (``outreach._is_credit_governed``), so a plan-less account\nspends its credits like a trial. A second revoke is a 400 (no comp).","operationId":"admin_revoke_comped_plan_api_v1_admin_clients__client_id__revoke_plan_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokePlanRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokePlanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/impersonate":{"post":{"tags":["admin"],"summary":"Admin Impersonate","description":"Issue a 15-minute access-token for ``client_id`` so an admin can see\nwhat the client sees. Refuses to impersonate other admins.\n\nThe token's ``sub`` is the impersonated client's id (so endpoints\noperate on the client's data), but it carries an ``act`` claim with\nthe admin's id and an ``imp`` flag so audit rows downstream can show\n\"admin X acting as client Y did Z\".","operationId":"admin_impersonate_api_v1_admin_clients__client_id__impersonate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImpersonateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImpersonateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/refund":{"post":{"tags":["admin"],"summary":"Admin Refund","description":"Record a refund already made externally and audit the original payment.\n\nReal Stripe refunds must be issued in Stripe; its webhook owns their ledger.","operationId":"admin_refund_api_v1_admin_clients__client_id__refund_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/set-disabled":{"post":{"tags":["admin"],"summary":"Admin Set Disabled","description":"Lock (disable) or unlock (enable) a client account. A disabled client\ncan't log in and every authenticated request is rejected (live DB check,\neffective immediately). Admin accounts cannot be disabled. Audit-logged.","operationId":"admin_set_disabled_api_v1_admin_clients__client_id__set_disabled_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetDisabledRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetDisabledResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/reset-2fa":{"post":{"tags":["admin"],"summary":"Admin Reset 2Fa","description":"Disable a client's TOTP 2FA (lockout recovery). Clears the secret + flag;\nthe client can re-enrol from their security settings. Audit-logged.","operationId":"admin_reset_2fa_api_v1_admin_clients__client_id__reset_2fa_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reset2FARequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reset2FAResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/resend-verification":{"post":{"tags":["admin"],"summary":"Admin Resend Verification","description":"Re-issue a fresh email-verification token and send the verify email.\nNo-op (``sent=False``) when the client is already verified. Audit-logged.","operationId":"admin_resend_verification_api_v1_admin_clients__client_id__resend_verification_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendVerificationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/linkedin-accounts/{account_id}/delete":{"post":{"tags":["admin"],"summary":"Admin Delete Linkedin Account","description":"Delete a LinkedIn account row (e.g. a dead seat that 404s on Unipile).\nDependent sequences / runs have ``account_id`` SET NULL by FK, so history is\npreserved (not cascade-deleted). Row-locked + audited.","operationId":"admin_delete_linkedin_account_api_v1_admin_linkedin_accounts__account_id__delete_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/delete":{"post":{"tags":["admin"],"summary":"Admin Delete Client","description":"Retired: the support path must preserve the grace period and billing.","operationId":"admin_delete_client_api_v1_admin_clients__client_id__delete_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteClientRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteClientResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/linkedin-accounts/{account_id}/refresh-health":{"post":{"tags":["admin"],"summary":"Admin Refresh Account Health","description":"Re-poll Unipile for this account's current status and reconcile our\nrow. Reuses the same status-mapping table as the hourly poller so the\nbutton and the background job can't disagree.","operationId":"admin_refresh_account_health_api_v1_admin_linkedin_accounts__account_id__refresh_health_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshHealthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/objectives":{"get":{"tags":["admin"],"summary":"Admin Client Objectives","description":"Distribution + outcome counts of generated messages by RESOLVED objective\n(spec §11). Only messages actually shaped by the objective layer carry\n``objective_resolved`` (flag-off / legacy rows are NULL and ignored). Reply\nattribution per objective is deferred (spec §10.2) — approval and sent are\nthe honest early signals; the sample-size flag guards against reading too\nmuch into a handful of messages.","operationId":"admin_client_objectives_api_v1_admin_clients__client_id__objectives_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminClientObjectives"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/set-campaign-first-ux":{"post":{"tags":["admin"],"summary":"Admin Set Campaign First Ux","description":"Flip a client onto (or off) the campaign-first UX. Sets/clears\n``campaign_first_ux_at`` — the timestamp is both the switch and the rollout\naudit trail (when each client was migrated). Reversible: enabled=false → NULL\n→ the client falls back to the legacy UX (all data changes are additive, so\nnothing else needs reverting). Audit-logged.","operationId":"admin_set_campaign_first_ux_api_v1_admin_clients__client_id__set_campaign_first_ux_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetCampaignFirstRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetCampaignFirstResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/rollout/cohorts":{"get":{"tags":["admin"],"summary":"Admin Rollout Cohorts","description":"Split real clients into active vs dormant for the campaign-first rollout\n(plan §10). Active = has an active sequence OR a send in the last 14 days;\neveryone else is dormant. Internal/test accounts (``analytics_excluded``) and\ndisabled accounts are excluded — they're flipped first anyway. There is no\n``last_login_at`` column, so recency comes from the last sent message.","operationId":"admin_rollout_cohorts_api_v1_admin_rollout_cohorts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolloutCohortsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/activation":{"get":{"tags":["admin"],"summary":"Admin Activation","operationId":"admin_activation_api_v1_admin_activation_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Activation Api V1 Admin Activation Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/clients/{client_id}/analytics-exclusion":{"patch":{"tags":["admin"],"summary":"Set Analytics Exclusion","operationId":"set_analytics_exclusion_api_v1_admin_clients__client_id__analytics_exclusion_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Client Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsExclusionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Analytics Exclusion Api V1 Admin Clients  Client Id  Analytics Exclusion Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/affiliates":{"post":{"tags":["admin"],"summary":"Create Affiliate","description":"Create a referral link. ``code`` must be unique (409 otherwise).","operationId":"create_affiliate_api_v1_admin_affiliates_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAffiliateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["admin"],"summary":"List Affiliates","operationId":"list_affiliates_api_v1_admin_affiliates_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Inactive"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AffiliateRow"},"title":"Response List Affiliates Api V1 Admin Affiliates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/affiliates/{affiliate_id}":{"get":{"tags":["admin"],"summary":"Get Affiliate","operationId":"get_affiliate_api_v1_admin_affiliates__affiliate_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"affiliate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Affiliate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["admin"],"summary":"Update Affiliate","description":"Edit a link. Rate/duration changes are FORWARD-ONLY: commissions already\naccrued snapshot their own rate, so history is never rewritten.","operationId":"update_affiliate_api_v1_admin_affiliates__affiliate_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"affiliate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Affiliate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAffiliateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/affiliates/{affiliate_id}/rotate-token":{"post":{"tags":["admin"],"summary":"Rotate Affiliate Token","description":"Rotate the portal access token — instantly revokes the old\n``/affiliate/{token}`` link and mints a new one. Use when a partner's link\nleaks. The new ``portal_url`` is in the response.","operationId":"rotate_affiliate_token_api_v1_admin_affiliates__affiliate_id__rotate_token_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"affiliate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Affiliate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/affiliates/{affiliate_id}/payouts":{"post":{"tags":["admin"],"summary":"Create Payout","description":"Record a manual payout: mark the affiliate's pending commissions paid and\nbundle them into one AffiliatePayout. The actual money moves off-app (bank /\nStripe dashboard); ``external_reference`` records where.\n\nConcurrency-safe: the pending rows are locked FOR UPDATE, so a double-submit\nfinds nothing pending on the second pass and 409s instead of double-paying.","operationId":"create_payout_api_v1_admin_affiliates__affiliate_id__payouts_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"affiliate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Affiliate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePayoutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/client-map":{"post":{"tags":["admin"],"summary":"Start Client Map","operationId":"start_client_map_api_v1_admin_client_map_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientMapBrief"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientMapStarted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/admin/client-map/{job_id}":{"get":{"tags":["admin"],"summary":"Get Client Map","operationId":"get_client_map_api_v1_admin_client_map__job_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Client Map Api V1 Admin Client Map  Job Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/client-map/{job_id}/retry":{"post":{"tags":["admin"],"summary":"Retry Client Map","operationId":"retry_client_map_api_v1_admin_client_map__job_id__retry_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientMapStarted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/affiliate/portal/{token}":{"get":{"tags":["affiliate"],"summary":"Affiliate Portal","operationId":"affiliate_portal_api_v1_affiliate_portal__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/unipile/account-connected":{"post":{"tags":["webhooks"],"summary":"Account Connected Webhook","description":"Receive Unipile's post-hosted-auth callback and create the\nLinkedInAccount row. Idempotent on ``external_account_id``.","operationId":"account_connected_webhook_api_v1_webhooks_unipile_account_connected_post","parameters":[{"name":"x-unipile-signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Unipile-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Account Connected Webhook Api V1 Webhooks Unipile Account Connected Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/unipile/relation-new":{"post":{"tags":["webhooks"],"summary":"Relation New Webhook","description":"Unipile ``new_relation`` (v1) / ``relation.new`` (v2): a connection was\naccepted. Stamps ``invite_accepted_at`` on any matching waiting sequence.\n\nWhy this exists (need.md §3.2/§3.3): today acceptance is detected by the DM\ngate spending a real profile view per waiting lead per day — roughly 200/day\non a busy seat against a 120/day budget that ONLY discovery reads and is\nnever blocked by, so the failure is silent: discovery stops enriching and\nscores leads blind while outreach looks healthy. Unipile does the polling\nfor this event on their side at randomised intervals, so it costs us nothing\nagainst LinkedIn. Documented latency is up to 8 hours.\n\nAlways 200, even when nothing matched. Most relation events are the seat's\nown organic networking, and a non-2xx makes Unipile retry a delivery that\nwas correctly a no-op.\n\nIdempotent by construction: ``record_acceptance`` is write-once, so a\nre-delivered event cannot walk the timestamp forward.","operationId":"relation_new_webhook_api_v1_webhooks_unipile_relation_new_post","parameters":[{"name":"x-unipile-signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Unipile-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Relation New Webhook Api V1 Webhooks Unipile Relation New Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/sendgrid/events":{"post":{"tags":["webhooks"],"summary":"Sendgrid Events Webhook","description":"Receive SendGrid event-webhook batches and apply side effects.\n\nReturns counters so the SendGrid dashboard ``Test event`` button shows\na useful response.","operationId":"sendgrid_events_webhook_api_v1_webhooks_sendgrid_events_post","parameters":[{"name":"x-twilio-email-event-webhook-signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Twilio-Email-Event-Webhook-Signature"}},{"name":"x-twilio-email-event-webhook-timestamp","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Twilio-Email-Event-Webhook-Timestamp"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Sendgrid Events Webhook Api V1 Webhooks Sendgrid Events Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/unsubscribe":{"get":{"tags":["unsubscribe"],"summary":"Unsubscribe Page","description":"The link in an email body opens a page with one button; the button\nPOSTs. A GET never changes anything (2026-10-13 release review SEC-8;\nRFC 8058 §3): link scanners (Safe Links, Mimecast, Proofpoint), a\nforwarded email or a colleague's click used to opt the lead out — and,\nwith HubSpot connected, unsubscribe the contact from ALL of the client's\nHubSpot email. In English, Polish or Russian (``_page_language``).","operationId":"unsubscribe_page_api_v1_unsubscribe_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}},{"name":"accept-language","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accept-Language"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["unsubscribe"],"summary":"Unsubscribe","description":"One-click unsubscribe. Sets ``Lead.email_opt_out=True`` on this lead\nand on every lead of the same client with the same address, records the\naddress on the client's suppression list (so it survives deletion and the\n90-day purge), and stops the open (active or paused) sequences of this\nlead, of those same-address rows and of the same person's other rows by\nLinkedIn profile (``_linkedin_twin_ids``). Renders a confirmation page.\n\nWe don't require any authentication — CAN-SPAM requires opt-out be\nprocessable in 10 days, and one-click is the Gmail/Outlook 2024\nbulk-sender requirement. A valid but expired link still works. The\npage speaks the lead's language (``_lead_language``), else the browser's.","operationId":"unsubscribe_api_v1_unsubscribe_post","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}},{"name":"accept-language","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accept-Language"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/google/login":{"get":{"tags":["auth"],"summary":"Google Login","description":"Generate a state, store it (with any affiliate ``ref`` code for first-touch\nattribution), and redirect to Google.","operationId":"google_login_api_v1_auth_google_login_get","parameters":[{"name":"ref","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref"}},{"name":"next","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/google/callback":{"get":{"tags":["auth"],"summary":"Google Callback","description":"Verify state, exchange code for ID token, find-or-create Client,\nissue NudgeLink JWT pair, redirect to dashboard.","operationId":"google_callback_api_v1_auth_google_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/google/mfa":{"post":{"tags":["auth"],"summary":"Google Mfa","description":"Finish a Google sign-in for a 2FA account: challenge + authenticator code.\n\nBrute force is bounded per challenge (``_MFA_MAX_ATTEMPTS`` wrong codes and\nit is deleted), per account and per network across challenges\n(``_MFA_MAX_FAILURES_PER_*`` wrong codes lock this step for\n``_MFA_LOCK_SECONDS``), and a code that already signed in is refused. No\n``@limiter.limit`` here: this module has ``from __future__ import\nannotations`` (the PEP 563 + slowapi hazard).","operationId":"google_mfa_api_v1_auth_google_mfa_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleMfaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/mcp/consent/{request_id}":{"get":{"tags":["mcp"],"summary":"Describe Consent Request","description":"Describe a parked authorization request so the page can render it.","operationId":"describe_consent_request_api_v1_mcp_consent__request_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentRequestOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/mcp/consent/approve":{"post":{"tags":["mcp"],"summary":"Approve Consent","description":"Grant the assistant access as the signed-in user.\n\n``user.id`` is the ONLY source of the tenant that gets stamped onto the\nauthorization — never anything from the request body. That is what keeps\none user from approving an assistant into someone else's account.","operationId":"approve_consent_api_v1_mcp_consent_approve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDecision"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentRedirectOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/consent/deny":{"post":{"tags":["mcp"],"summary":"Deny Consent","description":"Refuse, and hand back the RFC 6749 error redirect.\n\nThe request is burned here rather than left to expire, so a user who\nchanges their mind cannot have the same screen approved later.","operationId":"deny_consent_api_v1_mcp_consent_deny_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDecision"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentRedirectOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/consent":{"get":{"tags":["mcp"],"summary":"List Connected Assistants","description":"Assistants this account has connected — the settings view.\n\nScoped to ``user.id``; there is no parameter that could widen it.","operationId":"list_connected_assistants_api_v1_mcp_consent_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Connected Assistants Api V1 Mcp Consent Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/consent/linkedin-tools":{"post":{"tags":["mcp"],"summary":"Set Linkedin Tools","description":"Allow / forbid ONE connected assistant to use LinkedIn-automating tools.\n\nDirectory edition (2026-09-23): off by default. Scoped to ``user.id``; an\nunknown or revoked connection is a 404 rather than a silent no-op.","operationId":"set_linkedin_tools_api_v1_mcp_consent_linkedin_tools_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkedInToolsRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mcp/consent/disconnect":{"post":{"tags":["mcp"],"summary":"Disconnect Assistant","description":"Revoke an assistant's access for THIS account only.\n\nRevokes refresh grants and approved codes, which stops renewal. Tool calls\ncheck the authorization and grant revocation live, so existing access\ntokens are rejected too, including on an already-open MCP session.","operationId":"disconnect_assistant_api_v1_mcp_consent_disconnect_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/integrations/hubspot/connect":{"post":{"tags":["integrations"],"summary":"Connect","operationId":"connect_api_v1_integrations_hubspot_connect_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__integrations_hubspot__ConnectOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/integrations/hubspot/callback":{"get":{"tags":["integrations"],"summary":"Callback","description":"HubSpot's redirect target. Never shows a stack or token material — every\nfailure lands back on the settings page with a short outcome code.","operationId":"callback_api_v1_integrations_hubspot_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Error"}},{"name":"nudgelink_hubspot_oauth","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nudgelink Hubspot Oauth"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/hubspot/status":{"get":{"tags":["integrations"],"summary":"Get Status","operationId":"get_status_api_v1_integrations_hubspot_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/integrations/hubspot/deals/pipelines":{"get":{"tags":["integrations"],"summary":"Deal Pipelines","operationId":"deal_pipelines_api_v1_integrations_hubspot_deals_pipelines_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DealPipeline"},"type":"array","title":"Response Deal Pipelines Api V1 Integrations Hubspot Deals Pipelines Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/integrations/hubspot/deals":{"put":{"tags":["integrations"],"summary":"Set Deal Settings","description":"Checked against the portal's live pipelines, so a typo or a stage from\nanother pipeline can never be saved and fail later on a real reply.","operationId":"set_deal_settings_api_v1_integrations_hubspot_deals_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealSettingsIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/integrations/hubspot/sync":{"post":{"tags":["integrations"],"summary":"Sync Now","operationId":"sync_now_api_v1_integrations_hubspot_sync_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Sync Now Api V1 Integrations Hubspot Sync Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/integrations/hubspot/disconnect":{"post":{"tags":["integrations"],"summary":"Disconnect","description":"Revoke the token AND uninstall the app from the portal (both are\nmarketplace requirements, shown in the review video), then delete our\ntokens and mappings. Local deletion happens even if HubSpot is\nunreachable — the user asked to disconnect, and we must stop holding\ntheir tokens either way. Allowed without a plan (a downgraded client must\nstill be able to remove us).","operationId":"disconnect_api_v1_integrations_hubspot_disconnect_post","responses":{"204":{"description":"Successful Response"}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mailboxes":{"get":{"tags":["mailboxes"],"summary":"List Mailboxes","operationId":"list_mailboxes_api_v1_mailboxes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailboxList"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mailboxes/connect":{"post":{"tags":["mailboxes"],"summary":"Connect Mailbox","operationId":"connect_mailbox_api_v1_mailboxes_connect_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__mailboxes__ConnectOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/mailboxes/{mailbox_id}":{"patch":{"tags":["mailboxes"],"summary":"Update Mailbox","operationId":"update_mailbox_api_v1_mailboxes__mailbox_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Mailbox Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailboxPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailboxOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["mailboxes"],"summary":"Disconnect Mailbox","description":"Works without a plan: a downgraded client can still remove a mailbox.\nIt stops sending at once, even if Unipile is unreachable.\n\nRelease review 2026-10-13 (DB-1 / DB-2 / DB-6 / EMAIL-6): the row is kept\n(``disconnected``) instead of deleted, so every email already sent from it\nkeeps its ``mailbox_id`` and replies/bounces to it still match — and a\nreconnect of the same address reuses the row. If Unipile's delete fails\nthe row stays ``disconnecting`` with its account id, and\n``tasks/mailboxes.retry_disconnects`` retries until Unipile lets go.","operationId":"disconnect_mailbox_api_v1_mailboxes__mailbox_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Mailbox Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/unipile/mailbox-connected":{"post":{"tags":["webhooks"],"summary":"Mailbox Connected Webhook","description":"Unipile's hosted-auth callback for a mailbox. Idempotent on the\nUnipile account id.","operationId":"mailbox_connected_webhook_api_v1_webhooks_unipile_mailbox_connected_post","parameters":[{"name":"x-unipile-signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Unipile-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Mailbox Connected Webhook Api V1 Webhooks Unipile Mailbox Connected Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/unipile/email":{"post":{"tags":["webhooks"],"summary":"Email Webhook","operationId":"email_webhook_api_v1_webhooks_unipile_email_post","parameters":[{"name":"x-unipile-signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Unipile-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Email Webhook Api V1 Webhooks Unipile Email Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AICacheEfficiencyRow":{"properties":{"operation":{"type":"string","title":"Operation"},"model":{"type":"string","title":"Model"},"call_count":{"type":"integer","title":"Call Count"},"calls_reading_cache":{"type":"integer","title":"Calls Reading Cache"},"calls_writing_cache":{"type":"integer","title":"Calls Writing Cache"},"calls_uncached":{"type":"integer","title":"Calls Uncached"},"input_tokens":{"type":"integer","title":"Input Tokens"},"cache_read_tokens":{"type":"integer","title":"Cache Read Tokens"},"cache_write_tokens":{"type":"integer","title":"Cache Write Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"cost_usd":{"type":"number","title":"Cost Usd"},"cost_without_cache_usd":{"type":"number","title":"Cost Without Cache Usd"},"cache_saving_usd":{"type":"number","title":"Cache Saving Usd"}},"type":"object","required":["operation","model","call_count","calls_reading_cache","calls_writing_cache","calls_uncached","input_tokens","cache_read_tokens","cache_write_tokens","output_tokens","cost_usd","cost_without_cache_usd","cache_saving_usd"],"title":"AICacheEfficiencyRow"},"AIUsageSummary":{"properties":{"client_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Client Id"},"operation":{"type":"string","title":"Operation"},"call_count":{"type":"integer","title":"Call Count"},"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"cache_hit_count":{"type":"integer","title":"Cache Hit Count"},"cost_usd":{"type":"number","title":"Cost Usd"}},"type":"object","required":["client_id","operation","call_count","input_tokens","output_tokens","cache_hit_count","cost_usd"],"title":"AIUsageSummary"},"AcceptAllItem":{"properties":{"suggestion_id":{"type":"string","format":"uuid","title":"Suggestion Id"},"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"deduped":{"type":"boolean","title":"Deduped"}},"type":"object","required":["suggestion_id","lead_id","deduped"],"title":"AcceptAllItem"},"AcceptAllResponse":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"accepted":{"type":"integer","title":"Accepted"},"deduped":{"type":"integer","title":"Deduped"},"skipped":{"type":"integer","title":"Skipped"},"results":{"items":{"$ref":"#/components/schemas/AcceptAllItem"},"type":"array","title":"Results"}},"type":"object","required":["run_id","accepted","deduped","skipped","results"],"title":"AcceptAllResponse"},"AcceptRequest":{"properties":{"entity_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Entity Ids"},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}},"type":"object","required":["entity_ids"],"title":"AcceptRequest"},"AcceptResponse":{"properties":{"accepted":{"type":"integer","title":"Accepted"},"skipped":{"type":"integer","title":"Skipped"},"skipped_reasons":{"additionalProperties":{"type":"string"},"type":"object","title":"Skipped Reasons","default":{}}},"type":"object","required":["accepted","skipped"],"title":"AcceptResponse"},"AcceptSuggestionResponse":{"properties":{"suggestion_id":{"type":"string","format":"uuid","title":"Suggestion Id"},"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"status":{"type":"string","title":"Status"},"deduped":{"type":"boolean","title":"Deduped"}},"type":"object","required":["suggestion_id","lead_id","status","deduped"],"title":"AcceptSuggestionResponse"},"AccountHealthRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"client_id":{"type":"string","format":"uuid","title":"Client Id"},"client_email":{"type":"string","title":"Client Email"},"label":{"type":"string","title":"Label"},"status":{"type":"string","title":"Status"},"warmup_week":{"type":"integer","title":"Warmup Week"},"ban_count":{"type":"integer","title":"Ban Count"},"last_action_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Action At"},"external_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Account Id"}},"type":"object","required":["id","client_id","client_email","label","status","warmup_week","ban_count","last_action_at","external_account_id"],"title":"AccountHealthRow"},"ActivationEventIn":{"properties":{"event_type":{"type":"string","maxLength":48,"title":"Event Type"},"page":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Page"},"error_code":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Error Code"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta"}},"type":"object","required":["event_type"],"title":"ActivationEventIn"},"ActivationStartRequest":{"properties":{"suggestion_id":{"type":"string","format":"uuid","title":"Suggestion Id"},"mode":{"type":"string","const":"preview","title":"Mode","default":"preview"}},"type":"object","required":["suggestion_id"],"title":"ActivationStartRequest"},"ActivationStartResponse":{"properties":{"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"sequence_id":{"type":"string","format":"uuid","title":"Sequence Id"},"message_id":{"type":"string","format":"uuid","title":"Message Id"},"step":{"type":"string","title":"Step"},"preview_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview Status"},"content":{"type":"string","title":"Content"},"scheduled_send_not_before":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled Send Not Before"}},"type":"object","required":["lead_id","sequence_id","message_id","step","preview_status","content","scheduled_send_not_before"],"title":"ActivationStartResponse"},"ActivityItem":{"properties":{"type":{"type":"string","title":"Type"},"text_key":{"type":"string","title":"Text Key"},"params":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"object","title":"Params"},"ts":{"type":"string","format":"date-time","title":"Ts"},"href":{"type":"string","title":"Href"}},"type":"object","required":["type","text_key","params","ts","href"],"title":"ActivityItem","description":"One row in the merged, time-desc activity feed.\n\n``text_key`` is an i18n key the frontend resolves against\n``dashboard.activity.*`` (with ``params`` interpolated) — the backend never\nemits user-facing English (QA 2026-06-09 BUG-8). ``type`` drives the row's\ncolour dot; ``href`` is the relative page the row links to."},"AdminAccountMini":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"label":{"type":"string","title":"Label"},"status":{"type":"string","title":"Status"},"warmup_week":{"type":"integer","title":"Warmup Week"},"ban_count":{"type":"integer","title":"Ban Count"},"last_action_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Action At"}},"type":"object","required":["id","label","status","warmup_week","ban_count","last_action_at"],"title":"AdminAccountMini"},"AdminAuditMini":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"actor_role":{"type":"string","title":"Actor Role"},"action":{"type":"string","title":"Action"},"resource_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Type"},"resource_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Resource Id"}},"type":"object","required":["id","created_at","actor_role","action","resource_type","resource_id"],"title":"AdminAuditMini"},"AdminBillingMini":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_type":{"type":"string","title":"Event Type"},"amount":{"type":"number","title":"Amount"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","event_type","amount","reason","created_at"],"title":"AdminBillingMini"},"AdminCampaignRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"instruction_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instruction Note"},"icp_override":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Icp Override"},"uses_client_icp":{"type":"boolean","title":"Uses Client Icp"},"override_has_pitch":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Override Has Pitch"},"account_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Account Ids"},"leads_total":{"type":"integer","title":"Leads Total"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","status","instruction_note","icp_override","uses_client_icp","override_has_pitch","account_ids","leads_total","created_at"],"title":"AdminCampaignRow","description":"Sofia's ask (2026-07-14, Telegram): campaigns were invisible in admin,\nso \"which ICP does this campaign actually generate with\" (client-level vs\nicp_override — the coherence-plan §8.1 confusion) couldn't be checked.\nOne row per campaign, newest first, with the raw override for eyeballing.\n\n``override_has_pitch``: None when there is no override; else whether the\noverride states its own ``company_pitch``. When False, generation inherits\nthe client-level pitch (the \"override replaces targeting, never the\noffer\" merge rule shipped 2026-07-14)."},"AdminClientDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"company_name":{"type":"string","title":"Company Name"},"industry":{"type":"string","title":"Industry"},"role":{"type":"string","title":"Role"},"subscription_plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Plan"},"plan_comped":{"type":"boolean","title":"Plan Comped"},"guarantee_status":{"type":"string","title":"Guarantee Status"},"pilot_start_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pilot Start At"},"pilot_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pilot Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"email_verified":{"type":"boolean","title":"Email Verified"},"totp_enabled":{"type":"boolean","title":"Totp Enabled"},"google_sub":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Sub"},"microsoft_sub":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Microsoft Sub"},"disabled":{"type":"boolean","title":"Disabled"},"campaign_first_ux":{"type":"boolean","title":"Campaign First Ux","default":false},"credits_balance":{"type":"integer","title":"Credits Balance"},"credits_included":{"type":"integer","title":"Credits Included"},"credits_used_this_cycle":{"type":"integer","title":"Credits Used This Cycle"},"billing_cycle_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Billing Cycle Start"},"outreach_auto_send":{"type":"boolean","title":"Outreach Auto Send"},"languages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Languages"},"calibration_anchors":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Calibration Anchors"},"icp_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icp Summary"},"icp_criteria":{"items":{"type":"string"},"type":"array","title":"Icp Criteria","default":[]},"icp_keywords":{"items":{"type":"string"},"type":"array","title":"Icp Keywords","default":[]},"icp_industries":{"items":{"type":"string"},"type":"array","title":"Icp Industries","default":[]},"icp_skills":{"items":{"type":"string"},"type":"array","title":"Icp Skills","default":[]},"icp_locations":{"items":{"type":"string"},"type":"array","title":"Icp Locations","default":[]},"extra_accounts_count":{"type":"integer","title":"Extra Accounts Count"},"avg_deal_size_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Deal Size Usd"},"has_stripe_subscription":{"type":"boolean","title":"Has Stripe Subscription"},"total_paid_usd":{"type":"number","title":"Total Paid Usd"},"total_refunded_usd":{"type":"number","title":"Total Refunded Usd"},"comped_credits_total":{"type":"integer","title":"Comped Credits Total"},"net_revenue_usd":{"type":"number","title":"Net Revenue Usd"},"lead_count":{"type":"integer","title":"Lead Count"},"sequence_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Sequence Counts"},"account_count":{"type":"integer","title":"Account Count"},"accounts":{"items":{"$ref":"#/components/schemas/AdminAccountMini"},"type":"array","title":"Accounts"},"recent_sequences":{"items":{"$ref":"#/components/schemas/AdminSequenceMini"},"type":"array","title":"Recent Sequences"},"recent_billing":{"items":{"$ref":"#/components/schemas/AdminBillingMini"},"type":"array","title":"Recent Billing"},"recent_audit":{"items":{"$ref":"#/components/schemas/AdminAuditMini"},"type":"array","title":"Recent Audit"},"responded_leads":{"items":{"$ref":"#/components/schemas/AdminRespondedLead"},"type":"array","title":"Responded Leads"},"outreach_stats":{"$ref":"#/components/schemas/AdminClientOutreachStats"},"outreach":{"$ref":"#/components/schemas/OutreachStats"}},"type":"object","required":["id","email","company_name","industry","role","subscription_plan","plan_comped","guarantee_status","pilot_start_at","pilot_expires_at","created_at","email_verified","totp_enabled","google_sub","microsoft_sub","disabled","credits_balance","credits_included","credits_used_this_cycle","billing_cycle_start","outreach_auto_send","languages","extra_accounts_count","avg_deal_size_usd","has_stripe_subscription","total_paid_usd","total_refunded_usd","comped_credits_total","net_revenue_usd","lead_count","sequence_counts","account_count","accounts","recent_sequences","recent_billing","recent_audit","responded_leads","outreach_stats","outreach"],"title":"AdminClientDetail"},"AdminClientList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminClientRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"AdminClientList"},"AdminClientObjectives":{"properties":{"account_default":{"type":"string","title":"Account Default"},"total_generated":{"type":"integer","title":"Total Generated"},"sufficient_sample":{"type":"boolean","title":"Sufficient Sample"},"by_objective":{"items":{"$ref":"#/components/schemas/AdminObjectiveRow"},"type":"array","title":"By Objective"}},"type":"object","required":["account_default","total_generated","sufficient_sample","by_objective"],"title":"AdminClientObjectives"},"AdminClientOutreachStats":{"properties":{"invites_sent":{"type":"integer","title":"Invites Sent"},"messages_sent":{"type":"integer","title":"Messages Sent"},"replies":{"type":"integer","title":"Replies"},"positive_replies":{"type":"integer","title":"Positive Replies"},"reply_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reply Rate Pct"},"positive_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Positive Rate Pct"}},"type":"object","required":["invites_sent","messages_sent","replies","positive_replies","reply_rate_pct","positive_rate_pct"],"title":"AdminClientOutreachStats","description":"Per-client outreach success funnel (board ask 2026-07-13: \"% successful\nanswers\" on the client's admin page). Denominator is invites actually SENT\n— a connection request that left the building — not leads merely found, so\nthe rate isn't diluted by warmup-heavy pilots that haven't invited yet.\nreply_rate / positive_rate are None when nothing has been sent yet."},"AdminClientRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"company_name":{"type":"string","title":"Company Name"},"role":{"type":"string","title":"Role"},"subscription_plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Plan"},"plan_comped":{"type":"boolean","title":"Plan Comped"},"guarantee_status":{"type":"string","title":"Guarantee Status"},"pilot_start_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pilot Start At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"credits_balance":{"type":"integer","title":"Credits Balance"},"credits_included":{"type":"integer","title":"Credits Included"},"lead_count":{"type":"integer","title":"Lead Count"},"account_count":{"type":"integer","title":"Account Count"}},"type":"object","required":["id","email","company_name","role","subscription_plan","plan_comped","guarantee_status","pilot_start_at","created_at","credits_balance","credits_included","lead_count","account_count"],"title":"AdminClientRow"},"AdminEraseRequest":{"properties":{"reason":{"type":"string","maxLength":512,"minLength":1,"pattern":"\\S","title":"Reason"},"locale":{"type":"string","enum":["en","pl","ru"],"title":"Locale","default":"en"}},"type":"object","required":["reason"],"title":"AdminEraseRequest"},"AdminMessageRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"client_id":{"type":"string","format":"uuid","title":"Client Id"},"client_email":{"type":"string","title":"Client Email"},"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"lead_name":{"type":"string","title":"Lead Name"},"step":{"type":"string","title":"Step"},"channel":{"type":"string","title":"Channel"},"direction":{"type":"string","title":"Direction"},"preview_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview Status"},"classification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Classification"},"content":{"type":"string","title":"Content"},"source_post_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Post Text"},"source_post_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Post Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"}},"type":"object","required":["id","client_id","client_email","lead_id","lead_name","step","channel","direction","preview_status","classification","content","source_post_text","source_post_url","created_at","sent_at"],"title":"AdminMessageRow"},"AdminObjectiveRow":{"properties":{"objective":{"type":"string","title":"Objective"},"generated":{"type":"integer","title":"Generated"},"approved":{"type":"integer","title":"Approved"},"sent":{"type":"integer","title":"Sent"}},"type":"object","required":["objective","generated","approved","sent"],"title":"AdminObjectiveRow"},"AdminOverview":{"properties":{"total_clients":{"type":"integer","title":"Total Clients"},"paying_subscriptions":{"type":"integer","title":"Paying Subscriptions"},"active_pilots":{"type":"integer","title":"Active Pilots"},"comped_plans":{"type":"integer","title":"Comped Plans"},"new_signups_7d":{"type":"integer","title":"New Signups 7D"},"mrr_30d_usd":{"type":"number","title":"Mrr 30D Usd"},"ai_cost_30d_usd":{"type":"number","title":"Ai Cost 30D Usd"},"active_sequences":{"type":"integer","title":"Active Sequences"},"stalled_sequences":{"type":"integer","title":"Stalled Sequences"},"unhealthy_accounts":{"type":"integer","title":"Unhealthy Accounts"},"pilots_expiring_7d":{"type":"integer","title":"Pilots Expiring 7D"},"out_of_credit_clients":{"type":"integer","title":"Out Of Credit Clients"},"admin_actions_7d":{"type":"integer","title":"Admin Actions 7D"},"pilots_expiring_sample":{"items":{"$ref":"#/components/schemas/OverviewPilotExpiring"},"type":"array","title":"Pilots Expiring Sample"},"out_of_credit_sample":{"items":{"$ref":"#/components/schemas/OverviewOutOfCredit"},"type":"array","title":"Out Of Credit Sample"},"outreach":{"$ref":"#/components/schemas/OutreachStats"}},"type":"object","required":["total_clients","paying_subscriptions","active_pilots","comped_plans","new_signups_7d","mrr_30d_usd","ai_cost_30d_usd","active_sequences","stalled_sequences","unhealthy_accounts","pilots_expiring_7d","out_of_credit_clients","admin_actions_7d","pilots_expiring_sample","out_of_credit_sample","outreach"],"title":"AdminOverview"},"AdminRespondedLead":{"properties":{"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"name":{"type":"string","title":"Name"},"company":{"type":"string","title":"Company"},"title":{"type":"string","title":"Title"},"status":{"type":"string","title":"Status"},"relevance_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Relevance Score"},"last_inbound_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Inbound Text"},"last_inbound_classification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Inbound Classification"},"last_inbound_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Inbound At"}},"type":"object","required":["lead_id","name","company","title","status","relevance_score","last_inbound_text","last_inbound_classification","last_inbound_at"],"title":"AdminRespondedLead","description":"A lead who replied/converted, with a snapshot of their latest inbound\nmessage. Part 3 (Sofia's admin ask): lets an operator see who actually\nresponded and what they said, to judge message quality end-to-end."},"AdminSequenceMini":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"lead_name":{"type":"string","title":"Lead Name"},"status":{"type":"string","title":"Status"},"current_step":{"type":"string","title":"Current Step"},"next_action_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Action At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","lead_id","lead_name","status","current_step","next_action_at","updated_at"],"title":"AdminSequenceMini"},"AdminStats":{"properties":{"days":{"type":"integer","title":"Days"},"points":{"items":{"$ref":"#/components/schemas/StatsPoint"},"type":"array","title":"Points"},"totals":{"$ref":"#/components/schemas/StatsTotals"},"conversion":{"$ref":"#/components/schemas/StatsConversion"}},"type":"object","required":["days","points","totals","conversion"],"title":"AdminStats"},"AffiliateDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"commission_rate_percent":{"type":"number","title":"Commission Rate Percent"},"commission_duration_months":{"type":"integer","title":"Commission Duration Months"},"active":{"type":"boolean","title":"Active"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"signup_url":{"type":"string","title":"Signup Url"},"portal_url":{"type":"string","title":"Portal Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"stats":{"$ref":"#/components/schemas/AffiliateStats"},"referred_users":{"items":{"$ref":"#/components/schemas/ReferredUser"},"type":"array","title":"Referred Users"},"commissions":{"items":{"$ref":"#/components/schemas/CommissionRow"},"type":"array","title":"Commissions"},"payouts":{"items":{"$ref":"#/components/schemas/PayoutRow"},"type":"array","title":"Payouts"}},"type":"object","required":["id","code","name","contact_email","commission_rate_percent","commission_duration_months","active","note","signup_url","portal_url","created_at","stats","referred_users","commissions","payouts"],"title":"AffiliateDetail"},"AffiliateRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"commission_rate_percent":{"type":"number","title":"Commission Rate Percent"},"commission_duration_months":{"type":"integer","title":"Commission Duration Months"},"active":{"type":"boolean","title":"Active"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"signup_url":{"type":"string","title":"Signup Url"},"portal_url":{"type":"string","title":"Portal Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"stats":{"$ref":"#/components/schemas/AffiliateStats"}},"type":"object","required":["id","code","name","contact_email","commission_rate_percent","commission_duration_months","active","note","signup_url","portal_url","created_at","stats"],"title":"AffiliateRow"},"AffiliateStats":{"properties":{"signups":{"type":"integer","title":"Signups"},"active_subscriptions":{"type":"integer","title":"Active Subscriptions"},"mrr_usd":{"type":"number","title":"Mrr Usd"},"commission_pending_usd":{"type":"number","title":"Commission Pending Usd"},"commission_paid_usd":{"type":"number","title":"Commission Paid Usd"},"commission_total_usd":{"type":"number","title":"Commission Total Usd"}},"type":"object","required":["signups","active_subscriptions","mrr_usd","commission_pending_usd","commission_paid_usd","commission_total_usd"],"title":"AffiliateStats"},"AnalyticsExclusionRequest":{"properties":{"excluded":{"type":"boolean","title":"Excluded"}},"type":"object","required":["excluded"],"title":"AnalyticsExclusionRequest"},"ApproveMessageRequest":{"properties":{"edited_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Edited Content"}},"type":"object","title":"ApproveMessageRequest"},"AssignLeadsRequest":{"properties":{"lead_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":500,"minItems":1,"title":"Lead Ids"}},"type":"object","required":["lead_ids"],"title":"AssignLeadsRequest"},"AssignLeadsResponse":{"properties":{"assigned":{"type":"integer","title":"Assigned"}},"type":"object","required":["assigned"],"title":"AssignLeadsResponse"},"AttributionIn":{"properties":{"attribution":{"additionalProperties":true,"type":"object","title":"Attribution"}},"type":"object","required":["attribution"],"title":"AttributionIn"},"AuditRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"client_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Client Id"},"actor_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Actor Id"},"actor_role":{"type":"string","title":"Actor Role"},"action":{"type":"string","title":"Action"},"resource_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Type"},"resource_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Resource Id"},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"}},"type":"object","required":["id","created_at","client_id","actor_id","actor_role","action","resource_type","resource_id","ip_address"],"title":"AuditRow"},"BillingOverview":{"properties":{"mrr_estimate_usd":{"type":"number","title":"Mrr Estimate Usd"},"success_fees_this_month_usd":{"type":"number","title":"Success Fees This Month Usd"},"refunds_this_month_usd":{"type":"number","title":"Refunds This Month Usd"},"admin_grants_this_month_credits":{"type":"integer","title":"Admin Grants This Month Credits"},"active_pilot_count":{"type":"integer","title":"Active Pilot Count"},"active_subscription_count":{"type":"integer","title":"Active Subscription Count"}},"type":"object","required":["mrr_estimate_usd","success_fees_this_month_usd","refunds_this_month_usd","admin_grants_this_month_credits","active_pilot_count","active_subscription_count"],"title":"BillingOverview"},"BillingSummary":{"properties":{"subscription_plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Plan"},"guarantee_status":{"type":"string","title":"Guarantee Status"},"pilot_start_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pilot Start At"},"billing_cycle_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Billing Cycle Start"},"next_cycle_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Cycle At"},"paused_days_client":{"type":"integer","title":"Paused Days Client"},"paused_days_system":{"type":"integer","title":"Paused Days System"},"credits_balance":{"type":"integer","title":"Credits Balance","default":0},"credits_included":{"type":"integer","title":"Credits Included","default":0},"credits_used_this_cycle":{"type":"integer","title":"Credits Used This Cycle","default":0},"has_stripe_subscription":{"type":"boolean","title":"Has Stripe Subscription","default":false},"plan_comped":{"type":"boolean","title":"Plan Comped","default":false},"pilot_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pilot Expires At"},"plan_active":{"type":"boolean","title":"Plan Active","default":false}},"type":"object","required":["subscription_plan","guarantee_status","pilot_start_at","billing_cycle_start","next_cycle_at","paused_days_client","paused_days_system"],"title":"BillingSummary"},"BriefDraftRequest":{"properties":{"text":{"type":"string","maxLength":1000,"minLength":3,"title":"Text"}},"type":"object","required":["text"],"title":"BriefDraftRequest"},"BulkDeleteLeadsRequest":{"properties":{"lead_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":1000,"minItems":1,"title":"Lead Ids"}},"type":"object","required":["lead_ids"],"title":"BulkDeleteLeadsRequest"},"BulkDeleteLeadsResponse":{"properties":{"deleted":{"type":"integer","title":"Deleted"}},"type":"object","required":["deleted"],"title":"BulkDeleteLeadsResponse"},"BulkStartRequest":{"properties":{"lead_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":1000,"minItems":1,"title":"Lead Ids"}},"type":"object","required":["lead_ids"],"title":"BulkStartRequest","description":"The leads \"Start all\" counted (audit 2026-09-29 §2) — the action must\ntouch exactly the set the button showed."},"CampaignCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"instruction_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Instruction Note"},"icp_override":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Icp Override"},"account_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Account Ids"},"outreach_objective":{"anyOf":[{"$ref":"#/components/schemas/OutreachObjective"},{"type":"null"}]},"style_profile":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Style Profile"},"languages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Languages"}},"type":"object","required":["name"],"title":"CampaignCreate"},"CampaignOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"instruction_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instruction Note"},"icp_override":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Icp Override"},"account_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Account Ids"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"stats":{"$ref":"#/components/schemas/CampaignStats"},"outreach_objective":{"anyOf":[{"$ref":"#/components/schemas/OutreachObjective"},{"type":"null"}]},"resolved_outreach_objective":{"$ref":"#/components/schemas/OutreachObjective"},"outreach_objective_source":{"type":"string","title":"Outreach Objective Source"},"style_profile":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Style Profile"},"languages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Languages"},"email_mode":{"type":"string","title":"Email Mode","default":"off"},"mailbox_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Mailbox Id"}},"type":"object","required":["id","name","status","instruction_note","icp_override","account_ids","created_at","stats","outreach_objective","resolved_outreach_objective","outreach_objective_source","style_profile","languages"],"title":"CampaignOut"},"CampaignStats":{"properties":{"leads_total":{"type":"integer","title":"Leads Total"},"leads_by_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"Leads By Status"},"active_sequences":{"type":"integer","title":"Active Sequences"},"replied":{"type":"integer","title":"Replied"},"startable":{"type":"integer","title":"Startable","default":0},"pending_approvals":{"type":"integer","title":"Pending Approvals","default":0},"outreach":{"anyOf":[{"$ref":"#/components/schemas/OutreachStats"},{"type":"null"}]}},"type":"object","required":["leads_total","leads_by_status","active_sequences","replied"],"title":"CampaignStats"},"CampaignUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"instruction_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Instruction Note"},"icp_override":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Icp Override"},"account_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Account Ids"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"outreach_objective":{"anyOf":[{"$ref":"#/components/schemas/OutreachObjective"},{"type":"null"}]},"style_profile":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Style Profile"},"languages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Languages"},"email_mode":{"anyOf":[{"type":"string","enum":["off","first","parallel","after"]},{"type":"null"}],"title":"Email Mode"},"mailbox_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Mailbox Id"}},"type":"object","title":"CampaignUpdate"},"CancelRequest":{"properties":{"token":{"type":"string","maxLength":4096,"minLength":1,"title":"Token"}},"type":"object","required":["token"],"title":"CancelRequest"},"ChecklistItemOut":{"properties":{"key":{"type":"string","title":"Key"},"done":{"type":"boolean","title":"Done"}},"type":"object","required":["key","done"],"title":"ChecklistItemOut"},"ChecklistOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ChecklistItemOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ChecklistOut"},"ClientEconomicsRow":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"email":{"type":"string","title":"Email"},"company_name":{"type":"string","title":"Company Name"},"subscription_plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Plan"},"revenue_usd":{"type":"number","title":"Revenue Usd"},"refunds_usd":{"type":"number","title":"Refunds Usd"},"ai_cost_usd":{"type":"number","title":"Ai Cost Usd"},"comped_credits":{"type":"integer","title":"Comped Credits"},"gross_margin_usd":{"type":"number","title":"Gross Margin Usd"},"margin_pct":{"type":"number","title":"Margin Pct"}},"type":"object","required":["client_id","email","company_name","subscription_plan","revenue_usd","refunds_usd","ai_cost_usd","comped_credits","gross_margin_usd","margin_pct"],"title":"ClientEconomicsRow"},"ClientMapBrief":{"properties":{"prospect_company":{"type":"string","maxLength":200,"title":"Prospect Company","default":""},"prospect_person":{"type":"string","maxLength":200,"title":"Prospect Person","default":""},"offer":{"type":"string","maxLength":1000,"minLength":3,"title":"Offer"},"titles":{"items":{"type":"string"},"type":"array","maxItems":8,"minItems":1,"title":"Titles"},"company_type":{"type":"string","maxLength":300,"title":"Company Type","default":""},"industries":{"items":{"type":"string"},"type":"array","maxItems":8,"title":"Industries"},"locations":{"items":{"type":"string"},"type":"array","maxItems":5,"title":"Locations"},"exclude_companies":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Exclude Companies"},"language":{"type":"string","pattern":"^(pl|en)$","title":"Language","default":"pl"},"formal":{"type":"boolean","title":"Formal","default":true},"sender_name":{"type":"string","maxLength":120,"title":"Sender Name","default":""}},"type":"object","required":["offer","titles"],"title":"ClientMapBrief"},"ClientMapStarted":{"properties":{"job_id":{"type":"string","title":"Job Id"}},"type":"object","required":["job_id"],"title":"ClientMapStarted"},"ClientRole":{"type":"string","enum":["client","admin"],"title":"ClientRole"},"CommissionRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"client_id":{"type":"string","format":"uuid","title":"Client Id"},"client_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Email"},"amount_usd":{"type":"number","title":"Amount Usd"},"base_amount_usd":{"type":"number","title":"Base Amount Usd"},"rate_percent":{"type":"number","title":"Rate Percent"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"period_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Period End"},"stripe_invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Invoice Id"},"payout_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Payout Id"}},"type":"object","required":["id","client_id","client_email","amount_usd","base_amount_usd","rate_percent","status","created_at","period_start","period_end","stripe_invoice_id","payout_id"],"title":"CommissionRow"},"ConnectLinkedInRequest":{"properties":{"label":{"type":"string","maxLength":255,"title":"Label","default":""},"external_account_id":{"type":"string","maxLength":128,"title":"External Account Id"},"profile_url":{"type":"string","maxLength":512,"title":"Profile Url","default":""},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"}},"type":"object","required":["external_account_id"],"title":"ConnectLinkedInRequest"},"ConsentDecision":{"properties":{"request_id":{"type":"string","maxLength":128,"minLength":16,"title":"Request Id"}},"type":"object","required":["request_id"],"title":"ConsentDecision"},"ConsentRedirectOut":{"properties":{"redirect_url":{"type":"string","title":"Redirect Url"}},"type":"object","required":["redirect_url"],"title":"ConsentRedirectOut"},"ConsentRequestOut":{"properties":{"client_id":{"type":"string","title":"Client Id"},"client_name":{"type":"string","title":"Client Name"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"redirect_host":{"type":"string","title":"Redirect Host"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["client_id","client_name","scopes","redirect_host","expires_at"],"title":"ConsentRequestOut","description":"What the consent screen shows. No redirect URI, only its host."},"CreateAffiliateRequest":{"properties":{"code":{"type":"string","maxLength":64,"minLength":2,"title":"Code"},"name":{"type":"string","maxLength":255,"title":"Name","default":""},"contact_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Contact Email"},"commission_rate_percent":{"type":"number","maximum":100.0,"exclusiveMinimum":0.0,"title":"Commission Rate Percent"},"commission_duration_months":{"type":"integer","maximum":120.0,"minimum":1.0,"title":"Commission Duration Months"},"note":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Note"}},"type":"object","required":["code","commission_rate_percent","commission_duration_months"],"title":"CreateAffiliateRequest"},"CreateLeadRequest":{"properties":{"linkedin_url":{"type":"string","maxLength":512,"title":"Linkedin Url"},"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"},"name":{"type":"string","maxLength":255,"title":"Name","default":""},"title":{"type":"string","maxLength":255,"title":"Title","default":""},"company":{"type":"string","maxLength":255,"title":"Company","default":""},"location":{"type":"string","maxLength":255,"title":"Location","default":""},"source_keywords":{"items":{"type":"string"},"type":"array","title":"Source Keywords"}},"type":"object","required":["linkedin_url"],"title":"CreateLeadRequest"},"CreatePayoutRequest":{"properties":{"commission_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Commission Ids"},"external_reference":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"External Reference"},"note":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Note"}},"type":"object","title":"CreatePayoutRequest"},"CreateSequenceRequest":{"properties":{"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"account_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Account Id"},"mode":{"$ref":"#/components/schemas/SequenceMode","default":"preview"}},"type":"object","required":["lead_id"],"title":"CreateSequenceRequest"},"CreditHistoryItem":{"properties":{"at":{"type":"string","format":"date-time","title":"At"},"kind":{"type":"string","title":"Kind"},"action":{"type":"string","title":"Action"},"credits":{"type":"integer","title":"Credits"},"balance_after":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Balance After"}},"type":"object","required":["at","kind","action","credits"],"title":"CreditHistoryItem"},"CreditHistoryOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CreditHistoryItem"},"type":"array","title":"Items"},"since":{"type":"string","format":"date-time","title":"Since"},"totals":{"additionalProperties":{"type":"integer"},"type":"object","title":"Totals"},"next_before":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Before"},"next_before_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Next Before Id"}},"type":"object","required":["items","since","totals"],"title":"CreditHistoryOut"},"CreditStatusOut":{"properties":{"is_trial":{"type":"boolean","title":"Is Trial"},"out_of_credits":{"type":"boolean","title":"Out Of Credits"},"credits_balance":{"type":"integer","title":"Credits Balance"},"allowance":{"type":"integer","title":"Allowance"},"contacted":{"type":"integer","title":"Contacted"},"accepted":{"type":"integer","title":"Accepted"},"replied":{"type":"integer","title":"Replied"},"waiting":{"type":"integer","title":"Waiting"},"subscribe_bonus_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Subscribe Bonus Until"},"subscribe_bonus_credits":{"type":"integer","title":"Subscribe Bonus Credits"},"connect_bonus_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Connect Bonus Until"},"connect_bonus_credits":{"type":"integer","title":"Connect Bonus Credits"},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"},"plan_comped":{"type":"boolean","title":"Plan Comped","default":false},"pilot_ended":{"type":"boolean","title":"Pilot Ended","default":false},"pilot_running":{"type":"boolean","title":"Pilot Running","default":false}},"type":"object","required":["is_trial","out_of_credits","credits_balance","allowance","contacted","accepted","replied","waiting","subscribe_bonus_until","subscribe_bonus_credits","connect_bonus_until","connect_bonus_credits"],"title":"CreditStatusOut","description":"Feeds the dashboard's out-of-credits banner (services/credit_status.py)."},"DashboardKPI":{"properties":{"leads_total":{"type":"integer","title":"Leads Total"},"leads_in_outreach":{"type":"integer","title":"Leads In Outreach"},"leads_replied":{"type":"integer","title":"Leads Replied"},"accounts_active":{"type":"integer","title":"Accounts Active"},"accounts_warming":{"type":"integer","title":"Accounts Warming"},"sequences_active":{"type":"integer","title":"Sequences Active"},"sequences_paused":{"type":"integer","title":"Sequences Paused"},"messages_pending_preview":{"type":"integer","title":"Messages Pending Preview"},"qualified_replies_this_month":{"type":"integer","title":"Qualified Replies This Month"},"accept_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accept Rate Pct"},"avg_relevance_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Relevance Score"},"est_pipeline_usd":{"type":"number","title":"Est Pipeline Usd"},"invites_sent_today":{"type":"integer","title":"Invites Sent Today"},"invites_cap_today":{"type":"integer","title":"Invites Cap Today"},"messages_sent_7d":{"type":"integer","title":"Messages Sent 7D"},"replies_7d":{"type":"integer","title":"Replies 7D"},"sends_by_day":{"items":{"$ref":"#/components/schemas/SendsByDay"},"type":"array","title":"Sends By Day"},"stats":{"$ref":"#/components/schemas/OutreachStats"}},"type":"object","required":["leads_total","leads_in_outreach","leads_replied","accounts_active","accounts_warming","sequences_active","sequences_paused","messages_pending_preview","qualified_replies_this_month","accept_rate_pct","avg_relevance_score","est_pipeline_usd","invites_sent_today","invites_cap_today","messages_sent_7d","replies_7d","sends_by_day","stats"],"title":"DashboardKPI"},"DealPipeline":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"stages":{"items":{"$ref":"#/components/schemas/DealStage"},"type":"array","title":"Stages"}},"type":"object","required":["id","label","stages"],"title":"DealPipeline"},"DealSettingsIn":{"properties":{"pipeline_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Pipeline Id"},"stage_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Stage Id"}},"type":"object","title":"DealSettingsIn","description":"Both set = open a deal on a positive reply there; both null = no deals."},"DealStage":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"}},"type":"object","required":["id","label"],"title":"DealStage"},"DeleteAccountRequest":{"properties":{"reason":{"type":"string","maxLength":512,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"DeleteAccountRequest"},"DeleteAccountResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"deleted":{"type":"boolean","title":"Deleted"},"provider_disconnected":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Provider Disconnected"}},"type":"object","required":["id","deleted"],"title":"DeleteAccountResponse"},"DeleteClientRequest":{"properties":{"reason":{"type":"string","maxLength":512,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"DeleteClientRequest"},"DeleteClientResponse":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"deleted":{"type":"boolean","title":"Deleted"},"seats_total":{"type":"integer","title":"Seats Total"},"seats_disconnected":{"type":"integer","title":"Seats Disconnected"},"stripe_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Subscription Id"}},"type":"object","required":["client_id","deleted","seats_total","seats_disconnected"],"title":"DeleteClientResponse"},"DisconnectRequest":{"properties":{"client_id":{"type":"string","maxLength":64,"minLength":1,"title":"Client Id"}},"type":"object","required":["client_id"],"title":"DisconnectRequest"},"DiscoverEstimateOut":{"properties":{"target_limit":{"type":"integer","title":"Target Limit"},"deep_search":{"type":"boolean","title":"Deep Search"},"estimated_credits":{"type":"integer","title":"Estimated Credits"}},"type":"object","required":["target_limit","deep_search","estimated_credits"],"title":"DiscoverEstimateOut"},"DiscoverRequest":{"properties":{"target_limit":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Target Limit","default":5},"score_threshold":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Score Threshold","default":60},"extra_keywords":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":10},{"type":"null"}],"title":"Extra Keywords"},"deep_search":{"type":"boolean","title":"Deep Search","default":false},"filters":{"anyOf":[{"$ref":"#/components/schemas/SearchFilters"},{"type":"null"}]},"work_keywords":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Work Keywords"},"work_keywords_mode":{"type":"string","enum":["and","or"],"title":"Work Keywords Mode","default":"or"},"company_sizes":{"items":{"type":"string","enum":["1-10","11-50","51-200","201-500","501-1000","1001+"]},"type":"array","maxItems":6,"title":"Company Sizes"},"filter_labels":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Filter Labels"},"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"}},"type":"object","title":"DiscoverRequest"},"DiscoverResponse":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"status":{"type":"string","title":"Status"},"target_limit":{"type":"integer","title":"Target Limit"},"score_threshold":{"type":"integer","title":"Score Threshold"},"estimated_credits":{"type":"integer","title":"Estimated Credits"}},"type":"object","required":["run_id","status","target_limit","score_threshold","estimated_credits"],"title":"DiscoverResponse"},"DismissRequest":{"properties":{"entity_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":200,"title":"Entity Ids"},"undo":{"type":"boolean","title":"Undo","default":false}},"type":"object","required":["entity_ids"],"title":"DismissRequest"},"EraseRequest":{"properties":{"password":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Password"},"totp_code":{"anyOf":[{"type":"string","maxLength":6},{"type":"null"}],"title":"Totp Code"},"reauth_token":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Reauth Token"},"locale":{"type":"string","enum":["en","pl","ru"],"title":"Locale","default":"en"}},"type":"object","title":"EraseRequest"},"EvidenceField":{"properties":{"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"state":{"type":"string","title":"State"},"excerpt":{"type":"string","title":"Excerpt","default":""},"source_url":{"type":"string","title":"Source Url","default":""}},"type":"object","required":["state"],"title":"EvidenceField"},"ExtendPilotRequest":{"properties":{"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"reason":{"type":"string","maxLength":512,"minLength":1,"title":"Reason"}},"type":"object","required":["expires_at","reason"],"title":"ExtendPilotRequest"},"ExtendPilotResponse":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"old_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Old Expires At"},"new_expires_at":{"type":"string","format":"date-time","title":"New Expires At"},"sequences_resumed":{"type":"integer","title":"Sequences Resumed","default":0}},"type":"object","required":["client_id","old_expires_at","new_expires_at"],"title":"ExtendPilotResponse"},"ExtractVoiceRequest":{"properties":{"writing_samples":{"items":{"type":"string"},"type":"array","maxItems":10,"minItems":1,"title":"Writing Samples","description":"3-5 of the client's own posts / past DMs / emails. Their real voice is learned from these."}},"type":"object","required":["writing_samples"],"title":"ExtractVoiceRequest"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"GenerateICPInput":{"properties":{"company_pitch":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Company Pitch"},"target_persona":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Target Persona"},"tone_prefs":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Tone Prefs"},"website_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Website Url"}},"type":"object","title":"GenerateICPInput","description":"Loose variant of ``OnboardingInput`` for ``/onboarding/generate-icp``.\n\nThe fields are all optional so the FE can hit Regenerate without\nre-sending the business inputs every time — the endpoint backfills\nfrom the user's already-saved ``Client.icp_profile``. The endpoint\nitself enforces that *some* source (request body or stored profile)\nyields ≥ 10 char strings for all three fields before invoking\nClaude, and returns a clear 400 with the field name otherwise."},"GoogleMfaRequest":{"properties":{"challenge":{"type":"string","maxLength":128,"minLength":16,"title":"Challenge"},"totp_code":{"type":"string","maxLength":16,"minLength":1,"title":"Totp Code"}},"type":"object","required":["challenge","totp_code"],"title":"GoogleMfaRequest"},"GrantCreditsRequest":{"properties":{"amount":{"type":"integer","maximum":100000.0,"exclusiveMinimum":0.0,"title":"Amount","description":"positive number of credits"},"reason":{"type":"string","maxLength":512,"minLength":1,"title":"Reason"}},"type":"object","required":["amount","reason"],"title":"GrantCreditsRequest"},"GrantCreditsResponse":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"new_balance":{"type":"integer","title":"New Balance"},"billing_event_id":{"type":"string","format":"uuid","title":"Billing Event Id"},"granted_amount":{"type":"integer","title":"Granted Amount"}},"type":"object","required":["client_id","new_balance","billing_event_id","granted_amount"],"title":"GrantCreditsResponse"},"GrantPilotRequest":{"properties":{"plan":{"$ref":"#/components/schemas/SubscriptionPlan"},"reason":{"type":"string","maxLength":512,"minLength":1,"title":"Reason"},"free_days":{"type":"integer","maximum":365.0,"exclusiveMinimum":0.0,"title":"Free Days","default":30}},"type":"object","required":["plan","reason"],"title":"GrantPilotRequest"},"GrantPilotResponse":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"plan":{"type":"string","title":"Plan"},"credits_granted":{"type":"integer","title":"Credits Granted"},"new_balance":{"type":"integer","title":"New Balance"},"pilot_expires_at":{"type":"string","format":"date-time","title":"Pilot Expires At"},"billing_event_id":{"type":"string","format":"uuid","title":"Billing Event Id"},"sequences_resumed":{"type":"integer","title":"Sequences Resumed","default":0}},"type":"object","required":["client_id","plan","credits_granted","new_balance","pilot_expires_at","billing_event_id"],"title":"GrantPilotResponse"},"GrantPlanRequest":{"properties":{"plan":{"$ref":"#/components/schemas/SubscriptionPlan"},"reason":{"type":"string","maxLength":512,"minLength":1,"title":"Reason"}},"type":"object","required":["plan","reason"],"title":"GrantPlanRequest"},"GrantPlanResponse":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"plan":{"type":"string","title":"Plan"},"comped":{"type":"boolean","title":"Comped"},"credits_granted":{"type":"integer","title":"Credits Granted"},"new_balance":{"type":"integer","title":"New Balance"},"billing_event_id":{"type":"string","format":"uuid","title":"Billing Event Id"},"sequences_resumed":{"type":"integer","title":"Sequences Resumed","default":0}},"type":"object","required":["client_id","plan","comped","credits_granted","new_balance","billing_event_id"],"title":"GrantPlanResponse"},"GrantPreview":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"kind":{"type":"string","title":"Kind"},"current_balance":{"type":"integer","title":"Current Balance"},"current_included":{"type":"integer","title":"Current Included"},"current_plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Plan"},"current_comped":{"type":"boolean","title":"Current Comped"},"current_guarantee":{"type":"string","title":"Current Guarantee"},"has_stripe_subscription":{"type":"boolean","title":"Has Stripe Subscription"},"new_balance":{"type":"integer","title":"New Balance"},"new_included":{"type":"integer","title":"New Included"},"balance_delta":{"type":"integer","title":"Balance Delta"},"surplus_lost":{"type":"integer","title":"Surplus Lost"},"usd_value":{"type":"number","title":"Usd Value"},"est_leads":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Est Leads"},"resets_billing_cycle":{"type":"boolean","title":"Resets Billing Cycle"},"overwrites_plan":{"type":"boolean","title":"Overwrites Plan"},"pilot_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pilot Expires At"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"blockers":{"items":{"type":"string"},"type":"array","title":"Blockers"}},"type":"object","required":["client_id","kind","current_balance","current_included","current_plan","current_comped","current_guarantee","has_stripe_subscription","new_balance","new_included","balance_delta","surplus_lost","usd_value","est_leads","resets_billing_cycle","overwrites_plan","pilot_expires_at","warnings","blockers"],"title":"GrantPreview"},"GuaranteeStatus":{"type":"string","enum":["pilot","active","inactive"],"title":"GuaranteeStatus"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ICPApproveRequest":{"properties":{"icp":{"$ref":"#/components/schemas/ICPResponse"},"edits":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Edits"}},"type":"object","required":["icp"],"title":"ICPApproveRequest"},"ICPResponse":{"properties":{"summary":{"type":"string","title":"Summary"},"criteria":{"items":{"type":"string"},"type":"array","title":"Criteria"},"keywords":{"items":{"type":"string"},"type":"array","title":"Keywords"},"style_notes":{"items":{"type":"string"},"type":"array","title":"Style Notes"},"sample_message":{"type":"string","title":"Sample Message"},"locations":{"items":{"type":"string"},"type":"array","title":"Locations"},"industries":{"items":{"type":"string"},"type":"array","title":"Industries"},"skills":{"items":{"type":"string"},"type":"array","title":"Skills"},"titles":{"items":{"type":"string"},"type":"array","title":"Titles"},"calibration_anchors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Calibration Anchors"},"exclusions":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Exclusions"},"product_summary":{"type":"string","title":"Product Summary","default":""}},"type":"object","required":["summary","criteria","keywords","style_notes","sample_message"],"title":"ICPResponse"},"ICPUpdateRequest":{"properties":{"summary":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Summary"},"criteria":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Criteria"},"keywords":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Keywords"},"sample_message":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Sample Message"},"exclusions":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Exclusions"}},"type":"object","title":"ICPUpdateRequest","description":"Partial edit of the ICP body. Every field is optional; omitted fields\nkeep their current value."},"ImpersonateRequest":{"properties":{"reason":{"type":"string","maxLength":256,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"ImpersonateRequest"},"ImpersonateResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"Bearer"},"expires_in":{"type":"integer","title":"Expires In"},"impersonated_client_id":{"type":"string","format":"uuid","title":"Impersonated Client Id"},"impersonated_email":{"type":"string","title":"Impersonated Email"}},"type":"object","required":["access_token","expires_in","impersonated_client_id","impersonated_email"],"title":"ImpersonateResponse"},"ImportLeadRow":{"properties":{"linkedin_url":{"type":"string","maxLength":512,"title":"Linkedin Url","default":""},"name":{"type":"string","maxLength":255,"title":"Name","default":""},"title":{"type":"string","maxLength":255,"title":"Title","default":""},"company":{"type":"string","maxLength":255,"title":"Company","default":""},"location":{"type":"string","maxLength":255,"title":"Location","default":""},"email":{"type":"string","maxLength":320,"title":"Email","default":""}},"type":"object","title":"ImportLeadRow"},"ImportLeadsRequest":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/ImportLeadRow"},"type":"array","maxItems":1000,"minItems":1,"title":"Rows"},"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"}},"type":"object","required":["rows"],"title":"ImportLeadsRequest"},"ImportLeadsResponse":{"properties":{"created":{"type":"integer","title":"Created"},"duplicates":{"type":"integer","title":"Duplicates"},"failures":{"items":{"$ref":"#/components/schemas/ImportRowFailure"},"type":"array","title":"Failures"}},"type":"object","required":["created","duplicates","failures"],"title":"ImportLeadsResponse"},"ImportRowFailure":{"properties":{"row":{"type":"integer","title":"Row"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["row","reason"],"title":"ImportRowFailure"},"InboxConversationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/InboxConversationRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"unread_total":{"type":"integer","title":"Unread Total"}},"type":"object","required":["items","total","unread_total"],"title":"InboxConversationListResponse"},"InboxConversationRow":{"properties":{"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"name":{"type":"string","title":"Name"},"title":{"type":"string","title":"Title"},"company":{"type":"string","title":"Company"},"linkedin_url":{"type":"string","title":"Linkedin Url"},"lead_status":{"type":"string","title":"Lead Status"},"last_message_preview":{"type":"string","title":"Last Message Preview"},"last_message_direction":{"type":"string","title":"Last Message Direction"},"last_message_at":{"type":"string","format":"date-time","title":"Last Message At"},"unread_count":{"type":"integer","title":"Unread Count"},"total_inbound":{"type":"integer","title":"Total Inbound"},"last_inbound_classification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Inbound Classification"}},"type":"object","required":["lead_id","name","title","company","linkedin_url","lead_status","last_message_preview","last_message_direction","last_message_at","unread_count","total_inbound","last_inbound_classification"],"title":"InboxConversationRow","description":"One row in the conversation list (sidebar)."},"InboxMessageOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"direction":{"type":"string","title":"Direction"},"channel":{"type":"string","title":"Channel"},"content":{"type":"string","title":"Content"},"classification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Classification"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"sent_manually":{"type":"boolean","title":"Sent Manually"},"send_skipped":{"type":"boolean","title":"Send Skipped","default":false},"step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Step"},"delivery_status":{"type":"string","title":"Delivery Status","default":"pending"},"invite_note_rejected":{"type":"boolean","title":"Invite Note Rejected","default":false}},"type":"object","required":["id","direction","channel","content","classification","sent_at","created_at","sent_manually"],"title":"InboxMessageOut"},"InboxThreadResponse":{"properties":{"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"name":{"type":"string","title":"Name"},"title":{"type":"string","title":"Title"},"company":{"type":"string","title":"Company"},"location":{"type":"string","title":"Location"},"linkedin_url":{"type":"string","title":"Linkedin Url"},"lead_status":{"type":"string","title":"Lead Status"},"sequence_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Sequence Id"},"sequence_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sequence Status"},"sent_from_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sent From Account"},"sent_from_account_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Sent From Account Id"},"messages":{"items":{"$ref":"#/components/schemas/InboxMessageOut"},"type":"array","title":"Messages"}},"type":"object","required":["lead_id","name","title","company","location","linkedin_url","lead_status","sequence_id","sequence_status","sent_from_account","sent_from_account_id","messages"],"title":"InboxThreadResponse"},"InviteStats":{"properties":{"sent":{"type":"integer","title":"Sent","default":0},"with_note":{"type":"integer","title":"With Note","default":0},"without_note":{"type":"integer","title":"Without Note","default":0},"accepted":{"type":"integer","title":"Accepted","default":0},"accepted_with_note":{"type":"integer","title":"Accepted With Note","default":0},"accepted_without_note":{"type":"integer","title":"Accepted Without Note","default":0},"declined":{"type":"integer","title":"Declined","default":0},"unknown":{"type":"integer","title":"Unknown","default":0},"judged":{"type":"integer","title":"Judged","default":0},"judged_with_note":{"type":"integer","title":"Judged With Note","default":0},"judged_without_note":{"type":"integer","title":"Judged Without Note","default":0},"accept_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accept Rate Pct"},"accept_rate_with_note_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accept Rate With Note Pct"},"accept_rate_without_note_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accept Rate Without Note Pct"}},"type":"object","title":"InviteStats","description":"Connection requests. ``*_pct`` are None (never 0.0) on an empty base.\n\nTHREE outcomes, not two (added 2026-08-07 after the first production\nbackfill). An invite we sent is in exactly one of:\n\n  * **accepted**  — ``invite_accepted_at`` is stamped.\n  * **declined**  — we looked AFTER inviting and they are still not a\n    connection. \"Declined\" is shorthand: it also covers ignored.\n  * **unknown**   — we have no observation since the invite went out.\n\nThat third bucket is not a technicality. Relationship distance is only\nrefreshed by the DM gate, which runs when a sequence reaches\n``linkedin_followup_1``; ``warmup_view``'s blob is written BEFORE the invite\nand carries no timestamp at all. So a lead whose follow-up is still sitting\nin the preview queue has never been re-checked, and folding those into the\ndenominator reports them as rejections.\n\nThe first prod run showed exactly that: 379 invites, 376 \"not 1st-degree\",\nan 0.8% accept rate. Real cold-invite accept rates are 15-40%. Nearly all of\nthat 376 was \"we never looked\", and dividing by it would have put a\ncatastrophic-looking number in front of clients.\n\nSo ``accept_rate_pct`` divides by **accepted + declined** — what we actually\nknow — and ``unknown`` is reported alongside so the number can be read with\nits own confidence attached. The bucket shrinks toward zero once PR 2's\n``relation.new`` webhook lands, which is the real fix."},"KeywordSuggestionDecision":{"properties":{"action":{"type":"string","pattern":"^(accept|reject)$","title":"Action"},"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"}},"type":"object","required":["action"],"title":"KeywordSuggestionDecision"},"KeywordSuggestionOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"keywords":{"items":{"type":"string"},"type":"array","title":"Keywords"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["id","keywords","reason"],"title":"KeywordSuggestionOut"},"KillSwitchRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"reason":{"type":"string","maxLength":256,"minLength":1,"title":"Reason"}},"type":"object","required":["enabled","reason"],"title":"KillSwitchRequest"},"KillSwitchResponse":{"properties":{"outreach_paused":{"type":"boolean","title":"Outreach Paused"}},"type":"object","required":["outreach_paused"],"title":"KillSwitchResponse"},"LeadListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/LeadOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"LeadListResponse"},"LeadOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"title":{"type":"string","title":"Title"},"company":{"type":"string","title":"Company"},"location":{"type":"string","title":"Location"},"linkedin_url":{"type":"string","title":"Linkedin Url"},"relevance_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Relevance Score"},"relevance_reasoning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relevance Reasoning"},"status":{"$ref":"#/components/schemas/LeadStatus"},"content_brief":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Brief"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"email_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Source"},"source_keywords":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Source Keywords"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"}},"type":"object","required":["id","name","title","company","location","linkedin_url","relevance_score","relevance_reasoning","status","content_brief","email","email_source","source_keywords","created_at"],"title":"LeadOut"},"LeadStatus":{"type":"string","enum":["new","warming","outreach","replied","converted","rejected","skipped"],"title":"LeadStatus"},"LinkedInAccountOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"label":{"type":"string","title":"Label"},"external_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Account Id"},"profile_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Url"},"status":{"$ref":"#/components/schemas/LinkedInAccountStatus"},"warmup_week":{"type":"integer","title":"Warmup Week"},"daily_limits":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Daily Limits"},"daily_invite_cap":{"type":"integer","title":"Daily Invite Cap"},"timezone":{"type":"string","title":"Timezone","default":"UTC"},"invite_pace":{"type":"string","title":"Invite Pace","default":"safe"},"send_hour_start":{"type":"integer","title":"Send Hour Start","default":8},"send_hour_end":{"type":"integer","title":"Send Hour End","default":20},"send_days":{"items":{"type":"integer"},"type":"array","title":"Send Days","default":[1,2,3,4,5,6,7]},"last_action_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Action At"},"ban_count":{"type":"integer","title":"Ban Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"is_premium":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Premium"},"premium_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Premium Kind"}},"type":"object","required":["id","label","external_account_id","profile_url","status","warmup_week","daily_limits","daily_invite_cap","last_action_at","ban_count","created_at"],"title":"LinkedInAccountOut"},"LinkedInAccountStatus":{"type":"string","enum":["active","warming","paused_by_client","paused_by_system","requires_action","banned"],"title":"LinkedInAccountStatus"},"LinkedInToolsRequest":{"properties":{"client_id":{"type":"string","maxLength":64,"minLength":1,"title":"Client Id"},"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["client_id","enabled"],"title":"LinkedInToolsRequest"},"LoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"},"totp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Totp Code"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"MailboxList":{"properties":{"mailboxes":{"items":{"$ref":"#/components/schemas/MailboxOut"},"type":"array","title":"Mailboxes"},"limit":{"type":"integer","title":"Limit"},"can_add":{"type":"boolean","title":"Can Add"}},"type":"object","required":["mailboxes","limit","can_add"],"title":"MailboxList"},"MailboxOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"provider":{"type":"string","title":"Provider"},"address":{"type":"string","title":"Address"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"status":{"type":"string","title":"Status"},"paired_seat_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Paired Seat Id"},"daily_cap":{"type":"integer","title":"Daily Cap"},"cap_today":{"type":"integer","title":"Cap Today"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"}},"type":"object","required":["id","provider","address","display_name","status","paired_seat_id","daily_cap","cap_today","created_at"],"title":"MailboxOut"},"MailboxPatch":{"properties":{"paired_seat_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Paired Seat Id"},"daily_cap":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":1.0},{"type":"null"}],"title":"Daily Cap"}},"type":"object","title":"MailboxPatch","description":"Omit a field to leave it; ``paired_seat_id: null`` unpairs."},"ManualResolveRequest":{"properties":{"linkedin_url":{"type":"string","maxLength":512,"minLength":1,"title":"Linkedin Url"},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}},"type":"object","required":["linkedin_url"],"title":"ManualResolveRequest"},"ManualResolveResponse":{"properties":{"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"linkedin_url":{"type":"string","title":"Linkedin Url"}},"type":"object","required":["lead_id","linkedin_url"],"title":"ManualResolveResponse"},"MarkPreviewQueueSeenResponse":{"properties":{"seen_at":{"type":"string","format":"date-time","title":"Seen At"}},"type":"object","required":["seen_at"],"title":"MarkPreviewQueueSeenResponse"},"MarkReadResponse":{"properties":{"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"read_cursor":{"type":"string","format":"date-time","title":"Read Cursor"},"unread_count":{"type":"integer","title":"Unread Count"}},"type":"object","required":["lead_id","read_cursor","unread_count"],"title":"MarkReadResponse"},"MeResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","format":"email","title":"Email"},"company_name":{"type":"string","title":"Company Name"},"industry":{"type":"string","title":"Industry","default":""},"languages":{"items":{"type":"string"},"type":"array","title":"Languages","default":[]},"outreach_auto_send":{"type":"boolean","title":"Outreach Auto Send","default":false},"role":{"$ref":"#/components/schemas/ClientRole"},"email_verified":{"type":"boolean","title":"Email Verified"},"has_icp":{"type":"boolean","title":"Has Icp"},"has_style_profile":{"type":"boolean","title":"Has Style Profile"},"has_linkedin_account":{"type":"boolean","title":"Has Linkedin Account"},"subscription_plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Plan"},"totp_enabled":{"type":"boolean","title":"Totp Enabled","default":false},"campaign_first_ux":{"type":"boolean","title":"Campaign First Ux","default":false},"ui_tour_state":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Ui Tour State"},"avg_deal_size_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Deal Size Usd"},"outreach_mode_switched":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outreach Mode Switched"},"entitlements":{"additionalProperties":true,"type":"object","title":"Entitlements"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","company_name","role","email_verified","has_icp","has_style_profile","has_linkedin_account","subscription_plan","created_at"],"title":"MeResponse"},"MessageChannel":{"type":"string","enum":["linkedin","email"],"title":"MessageChannel"},"MessageClassification":{"type":"string","enum":["positive","neutral","question","rejection","spam","unclassified"],"title":"MessageClassification"},"MessageDirection":{"type":"string","enum":["outbound","inbound"],"title":"MessageDirection"},"MessageOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"sequence_id":{"type":"string","format":"uuid","title":"Sequence Id"},"step":{"$ref":"#/components/schemas/OutreachStep"},"channel":{"$ref":"#/components/schemas/MessageChannel"},"direction":{"$ref":"#/components/schemas/MessageDirection"},"content":{"type":"string","title":"Content"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"content_ai_original":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Ai Original"},"message_angle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Angle"},"classification":{"anyOf":[{"$ref":"#/components/schemas/MessageClassification"},{"type":"null"}]},"preview_status":{"anyOf":[{"$ref":"#/components/schemas/MessagePreviewStatus"},{"type":"null"}]},"preview_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Preview Expires At"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"sent_manually":{"type":"boolean","title":"Sent Manually"},"send_skipped":{"type":"boolean","title":"Send Skipped","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"external_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Url"},"source_post_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Post Text"},"source_post_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Post Url"}},"type":"object","required":["id","sequence_id","step","channel","direction","content","content_ai_original","message_angle","classification","preview_status","preview_expires_at","sent_at","sent_manually","created_at"],"title":"MessageOut"},"MessagePreviewStatus":{"type":"string","enum":["pending","approved","edited_and_approved","rejected","auto_sent","expired"],"title":"MessagePreviewStatus"},"MonthlyStats":{"properties":{"month":{"type":"string","title":"Month"},"invites":{"$ref":"#/components/schemas/InviteStats"}},"type":"object","required":["month"],"title":"MonthlyStats","description":"One calendar month of the invite block (2026-08-20, Sofia: \"чтобы инфа\nотдельно распределялась, по месяцам\").\n\nInvites ONLY — not replies. Invites are windowed by ``Message.sent_at``,\nwhich has a clean month; a reply has no ``sent_at`` (it is keyed off inbound\n``created_at``), so a per-month reply rate would divide a ``sent_at``-windowed\ndenominator by a ``created_at``-windowed numerator — two different ranges.\nThe accept rate is the number the monthly view exists to show, so it carries\nthe whole :class:`InviteStats` and leaves replies to the all-time block."},"MonthlyStatsResponse":{"properties":{"months":{"items":{"$ref":"#/components/schemas/MonthlyStats"},"type":"array","title":"Months"}},"type":"object","required":["months"],"title":"MonthlyStatsResponse"},"NotificationPrefs":{"properties":{"email":{"type":"boolean","title":"Email","default":true},"telegram":{"type":"boolean","title":"Telegram","default":false},"categories":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Categories"}},"type":"object","title":"NotificationPrefs"},"OnboardingInput":{"properties":{"company_pitch":{"type":"string","maxLength":5000,"minLength":10,"title":"Company Pitch","description":"1–3 sentence elevator pitch for the company."},"target_persona":{"type":"string","maxLength":5000,"minLength":10,"title":"Target Persona","description":"Role, stage, industry and geography of the ideal customer."},"tone_prefs":{"type":"string","maxLength":5000,"minLength":10,"title":"Tone Prefs","description":"How outreach messages should sound — tone, style, examples."},"industry":{"type":"string","title":"Industry","default":""},"avg_deal_size_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Deal Size Usd"},"languages":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Languages"}},"type":"object","required":["company_pitch","target_persona","tone_prefs"],"title":"OnboardingInput"},"OutreachObjective":{"type":"string","enum":["adaptive","conversation","problem_discovery","offer"],"title":"OutreachObjective","description":"The job the FIRST substantive message should accomplish\n(Outreach Objective Layer spec, 2026-07-20). A layer ABOVE the Voice\nEngine — it controls the message's goal and CTA, never the voice.\n\n``adaptive`` = NudgeLink resolves the concrete objective per lead from\nfit (relevance_score), intent (intent_score) and signals; the other three\nare the resolvable concrete objectives. Deliberately NOT a 1/2/3 scale —\nthese are different jobs, not different aggressiveness levels. Member names\nequal their values (house convention) so SAEnum name/value storage agrees."},"OutreachStats":{"properties":{"invites":{"$ref":"#/components/schemas/InviteStats"},"replies":{"$ref":"#/components/schemas/ReplyStats"},"comments_sent":{"type":"integer","title":"Comments Sent","default":0}},"type":"object","title":"OutreachStats"},"OutreachStep":{"type":"string","enum":["pending","warmup_view","warmup_like","warmup_comment","linkedin_invite","linkedin_followup_1","linkedin_followup_2","email_1","email_2","completed"],"title":"OutreachStep"},"OverviewOutOfCredit":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"email":{"type":"string","title":"Email"},"company_name":{"type":"string","title":"Company Name"},"credits_balance":{"type":"integer","title":"Credits Balance"},"subscription_plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Plan"}},"type":"object","required":["client_id","email","company_name","credits_balance","subscription_plan"],"title":"OverviewOutOfCredit"},"OverviewPilotExpiring":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"email":{"type":"string","title":"Email"},"company_name":{"type":"string","title":"Company Name"},"pilot_expires_at":{"type":"string","format":"date-time","title":"Pilot Expires At"},"days_left":{"type":"integer","title":"Days Left"}},"type":"object","required":["client_id","email","company_name","pilot_expires_at","days_left"],"title":"OverviewPilotExpiring"},"PauseCampaignResponse":{"properties":{"paused_sequences":{"type":"integer","title":"Paused Sequences"}},"type":"object","required":["paused_sequences"],"title":"PauseCampaignResponse"},"PayoutResult":{"properties":{"payout_id":{"type":"string","format":"uuid","title":"Payout Id"},"affiliate_id":{"type":"string","format":"uuid","title":"Affiliate Id"},"total_amount_usd":{"type":"number","title":"Total Amount Usd"},"commission_count":{"type":"integer","title":"Commission Count"},"paid_at":{"type":"string","format":"date-time","title":"Paid At"}},"type":"object","required":["payout_id","affiliate_id","total_amount_usd","commission_count","paid_at"],"title":"PayoutResult"},"PayoutRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"total_amount_usd":{"type":"number","title":"Total Amount Usd"},"commission_count":{"type":"integer","title":"Commission Count"},"paid_at":{"type":"string","format":"date-time","title":"Paid At"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["id","total_amount_usd","commission_count","paid_at","external_reference","note"],"title":"PayoutRow"},"PortalCommission":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At"},"amount_usd":{"type":"number","title":"Amount Usd"},"status":{"type":"string","title":"Status"}},"type":"object","required":["created_at","amount_usd","status"],"title":"PortalCommission"},"PortalPayout":{"properties":{"paid_at":{"type":"string","format":"date-time","title":"Paid At"},"total_amount_usd":{"type":"number","title":"Total Amount Usd"},"commission_count":{"type":"integer","title":"Commission Count"}},"type":"object","required":["paid_at","total_amount_usd","commission_count"],"title":"PortalPayout"},"PortalReferral":{"properties":{"signed_up_at":{"type":"string","format":"date-time","title":"Signed Up At"},"stage":{"type":"string","title":"Stage"},"is_paying":{"type":"boolean","title":"Is Paying"},"commission_earned_usd":{"type":"number","title":"Commission Earned Usd"}},"type":"object","required":["signed_up_at","stage","is_paying","commission_earned_usd"],"title":"PortalReferral"},"PortalResponse":{"properties":{"name":{"type":"string","title":"Name"},"commission_rate_percent":{"type":"number","title":"Commission Rate Percent"},"commission_duration_months":{"type":"integer","title":"Commission Duration Months"},"active":{"type":"boolean","title":"Active"},"stats":{"$ref":"#/components/schemas/PortalStats"},"referrals":{"items":{"$ref":"#/components/schemas/PortalReferral"},"type":"array","title":"Referrals"},"commissions":{"items":{"$ref":"#/components/schemas/PortalCommission"},"type":"array","title":"Commissions"},"payouts":{"items":{"$ref":"#/components/schemas/PortalPayout"},"type":"array","title":"Payouts"}},"type":"object","required":["name","commission_rate_percent","commission_duration_months","active","stats","referrals","commissions","payouts"],"title":"PortalResponse"},"PortalStats":{"properties":{"signups":{"type":"integer","title":"Signups"},"active_subscriptions":{"type":"integer","title":"Active Subscriptions"},"mrr_usd":{"type":"number","title":"Mrr Usd"},"commission_pending_usd":{"type":"number","title":"Commission Pending Usd"},"commission_paid_usd":{"type":"number","title":"Commission Paid Usd"},"commission_total_usd":{"type":"number","title":"Commission Total Usd"}},"type":"object","required":["signups","active_subscriptions","mrr_usd","commission_pending_usd","commission_paid_usd","commission_total_usd"],"title":"PortalStats"},"PreviewMessageOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"sequence_id":{"type":"string","format":"uuid","title":"Sequence Id"},"step":{"$ref":"#/components/schemas/OutreachStep"},"channel":{"$ref":"#/components/schemas/MessageChannel"},"direction":{"$ref":"#/components/schemas/MessageDirection"},"content":{"type":"string","title":"Content"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"content_ai_original":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Ai Original"},"message_angle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Angle"},"classification":{"anyOf":[{"$ref":"#/components/schemas/MessageClassification"},{"type":"null"}]},"preview_status":{"anyOf":[{"$ref":"#/components/schemas/MessagePreviewStatus"},{"type":"null"}]},"preview_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Preview Expires At"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"sent_manually":{"type":"boolean","title":"Sent Manually"},"send_skipped":{"type":"boolean","title":"Send Skipped","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"external_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Url"},"source_post_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Post Text"},"source_post_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Post Url"},"lead_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Lead Id"},"lead_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Name"},"lead_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Title"},"lead_company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Company"},"lead_linkedin_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Linkedin Url"},"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"},"campaign_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Name"}},"type":"object","required":["id","sequence_id","step","channel","direction","content","content_ai_original","message_angle","classification","preview_status","preview_expires_at","sent_at","sent_manually","created_at"],"title":"PreviewMessageOut","description":"A queue item plus who it is for (2026-10-12).\n\nThe queue showed a draft with no recipient: the user was asked to approve a\nmessage to someone the page never named. These are read off the sequence's\nlead (and the lead's campaign), all optional so an older client ignores them."},"PreviewQueueResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PreviewMessageOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"new_count":{"type":"integer","title":"New Count","default":0}},"type":"object","required":["items","total"],"title":"PreviewQueueResponse"},"PreviewWarning":{"properties":{"code":{"type":"string","title":"Code"},"terms":{"items":{"type":"string"},"type":"array","title":"Terms","default":[]}},"type":"object","required":["code"],"title":"PreviewWarning"},"ReconcileRequest":{"properties":{"reference":{"type":"string","maxLength":128,"minLength":8,"pattern":"^[A-Za-z0-9:_./-]+$","title":"Reference"},"input_tokens":{"type":"integer","maximum":10000000.0,"minimum":0.0,"title":"Input Tokens"},"output_tokens":{"type":"integer","maximum":10000000.0,"minimum":0.0,"title":"Output Tokens","default":0},"cache_creation_input_tokens":{"type":"integer","maximum":10000000.0,"minimum":0.0,"title":"Cache Creation Input Tokens","default":0},"cache_read_input_tokens":{"type":"integer","maximum":10000000.0,"minimum":0.0,"title":"Cache Read Input Tokens","default":0}},"type":"object","required":["reference","input_tokens"],"title":"ReconcileRequest"},"ReferredUser":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"email":{"type":"string","title":"Email"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"signed_up_at":{"type":"string","format":"date-time","title":"Signed Up At"},"first_paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Paid At"},"stage":{"type":"string","title":"Stage"},"subscription_plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Plan"},"is_paying":{"type":"boolean","title":"Is Paying"},"mrr_usd":{"type":"number","title":"Mrr Usd"},"commission_pending_usd":{"type":"number","title":"Commission Pending Usd"},"commission_paid_usd":{"type":"number","title":"Commission Paid Usd"}},"type":"object","required":["client_id","email","company","signed_up_at","first_paid_at","stage","subscription_plan","is_paying","mrr_usd","commission_pending_usd","commission_paid_usd"],"title":"ReferredUser"},"RefreshAnchorsResponse":{"properties":{"updated":{"type":"boolean","title":"Updated"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"counts":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Counts"},"anchors":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Anchors"}},"type":"object","required":["updated"],"title":"RefreshAnchorsResponse"},"RefreshHealthResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"old_status":{"type":"string","title":"Old Status"},"new_status":{"type":"string","title":"New Status"},"changed":{"type":"boolean","title":"Changed"}},"type":"object","required":["id","old_status","new_status","changed"],"title":"RefreshHealthResponse"},"RefreshRequest":{"properties":{"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"}},"type":"object","title":"RefreshRequest"},"RefundRequest":{"properties":{"billing_event_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Billing Event Id","description":"Original BillingEvent to refund (optional, for traceability)"},"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string"}],"title":"Amount","description":"USD amount to refund"},"reason":{"type":"string","maxLength":512,"minLength":1,"title":"Reason"}},"type":"object","required":["amount","reason"],"title":"RefundRequest"},"RefundResponse":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"refund_billing_event_id":{"type":"string","format":"uuid","title":"Refund Billing Event Id"},"refunded_amount":{"type":"number","title":"Refunded Amount"},"stripe_refund_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Refund Id"},"original_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Original Amount"},"already_refunded":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Already Refunded"},"remaining_refundable":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Remaining Refundable"}},"type":"object","required":["client_id","refund_billing_event_id","refunded_amount","stripe_refund_id"],"title":"RefundResponse"},"RegisterRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":128,"minLength":12,"title":"Password"},"company_name":{"type":"string","maxLength":255,"title":"Company Name","default":""},"referral_code":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Referral Code"}},"type":"object","required":["email","password"],"title":"RegisterRequest"},"ReplyRequest":{"properties":{"content":{"type":"string","maxLength":8000,"minLength":1,"title":"Content"}},"type":"object","required":["content"],"title":"ReplyRequest"},"ReplyStats":{"properties":{"dms_sent":{"type":"integer","title":"Dms Sent","default":0},"emails_sent":{"type":"integer","title":"Emails Sent","default":0},"contacted":{"type":"integer","title":"Contacted","default":0},"replied":{"type":"integer","title":"Replied","default":0},"reply_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reply Rate Pct"},"positive":{"type":"integer","title":"Positive","default":0},"neutral":{"type":"integer","title":"Neutral","default":0},"negative":{"type":"integer","title":"Negative","default":0},"unclassified":{"type":"integer","title":"Unclassified","default":0},"silent":{"type":"integer","title":"Silent","default":0}},"type":"object","title":"ReplyStats","description":"Messages sent and what came back.\n\n``contacted`` counts SEQUENCES (people) reached by any substantive step, not\nmessages — an invite plus two follow-ups to one lead is one person.\n``silent`` is the complement, so\npositive + neutral + negative + unclassified + silent == contacted."},"ResendVerificationResponse":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"sent":{"type":"boolean","title":"Sent"},"already_verified":{"type":"boolean","title":"Already Verified"}},"type":"object","required":["client_id","sent","already_verified"],"title":"ResendVerificationResponse"},"Reset2FARequest":{"properties":{"reason":{"type":"string","maxLength":512,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"Reset2FARequest"},"Reset2FAResponse":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"totp_enabled":{"type":"boolean","title":"Totp Enabled"}},"type":"object","required":["client_id","totp_enabled"],"title":"Reset2FAResponse"},"ResetPasswordRequest":{"properties":{"token":{"type":"string","title":"Token"},"new_password":{"type":"string","maxLength":128,"minLength":12,"title":"New Password"}},"type":"object","required":["token","new_password"],"title":"ResetPasswordRequest"},"ResumeCampaignResponse":{"properties":{"resumed_sequences":{"type":"integer","title":"Resumed Sequences"}},"type":"object","required":["resumed_sequences"],"title":"ResumeCampaignResponse"},"RevokePlanRequest":{"properties":{"reason":{"type":"string","maxLength":512,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"RevokePlanRequest"},"RevokePlanResponse":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"},"comped":{"type":"boolean","title":"Comped"},"new_balance":{"type":"integer","title":"New Balance"},"sequences_paused":{"type":"integer","title":"Sequences Paused"}},"type":"object","required":["client_id","plan","comped","new_balance","sequences_paused"],"title":"RevokePlanResponse"},"RolloutCohortRow":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"email":{"type":"string","title":"Email"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"active_sequences":{"type":"integer","title":"Active Sequences"},"leads":{"type":"integer","title":"Leads"},"last_send_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Send At"},"flipped":{"type":"boolean","title":"Flipped"},"cohort":{"type":"string","title":"Cohort"}},"type":"object","required":["client_id","email","company","active_sequences","leads","last_send_at","flipped","cohort"],"title":"RolloutCohortRow"},"RolloutCohortsResponse":{"properties":{"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"active":{"items":{"$ref":"#/components/schemas/RolloutCohortRow"},"type":"array","title":"Active"},"dormant":{"items":{"$ref":"#/components/schemas/RolloutCohortRow"},"type":"array","title":"Dormant"}},"type":"object","required":["generated_at","active","dormant"],"title":"RolloutCohortsResponse"},"RunDetailOut":{"properties":{"run":{"$ref":"#/components/schemas/RunOut"},"suggestions":{"items":{"$ref":"#/components/schemas/SuggestionOut"},"type":"array","title":"Suggestions"}},"type":"object","required":["run","suggestions"],"title":"RunDetailOut"},"RunOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"type":"string","title":"Status"},"target_limit":{"type":"integer","title":"Target Limit"},"score_threshold":{"type":"integer","title":"Score Threshold"},"searched_count":{"type":"integer","title":"Searched Count"},"scored_count":{"type":"integer","title":"Scored Count"},"suggested_count":{"type":"integer","title":"Suggested Count"},"credits_used":{"type":"integer","title":"Credits Used"},"queries_used":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Queries Used"},"filters_used":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filters Used"},"score_distribution":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Score Distribution"},"funnel":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Funnel"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"discovery_mode":{"type":"string","title":"Discovery Mode","default":"linkedin"},"enriched_count":{"type":"integer","title":"Enriched Count","default":0},"can_run_again":{"type":"boolean","title":"Can Run Again","default":false}},"type":"object","required":["id","status","target_limit","score_threshold","searched_count","scored_count","suggested_count","credits_used","queries_used","failure_reason","created_at","completed_at"],"title":"RunOut"},"ScoutBrief":{"properties":{"mode":{"anyOf":[{"type":"string","enum":["titles","companies","lookalike"]},{"type":"null"}],"title":"Mode"},"target_companies":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":25},{"type":"null"}],"title":"Target Companies"},"seed_companies":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":5},{"type":"null"}],"title":"Seed Companies"},"titles":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":10},{"type":"null"}],"title":"Titles"},"industries":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":5},{"type":"null"}],"title":"Industries"},"locations":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":5},{"type":"null"}],"title":"Locations"},"exclude_titles":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":25},{"type":"null"}],"title":"Exclude Titles"},"exclude_companies":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50},{"type":"null"}],"title":"Exclude Companies"}},"type":"object","title":"ScoutBrief","description":"None = keep the campaign's value; a list (even empty) replaces it.\n\n``mode``: titles (a role in a market), companies (those roles at the\n``target_companies`` listed), lookalike (companies like ``seed_companies``,\nthen the roles at the companies found)."},"ScoutEntityList":{"properties":{"entities":{"items":{"$ref":"#/components/schemas/ScoutEntityOut"},"type":"array","title":"Entities"}},"type":"object","required":["entities"],"title":"ScoutEntityList"},"ScoutEntityOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"entity_type":{"type":"string","title":"Entity Type"},"display_name":{"type":"string","title":"Display Name"},"canonical_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Domain"},"resolution_state":{"type":"string","title":"Resolution State"},"linkedin_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linkedin Url"},"parent_entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Entity Id"},"campaign_ready":{"type":"boolean","title":"Campaign Ready"},"fields":{"additionalProperties":{"$ref":"#/components/schemas/EvidenceField"},"type":"object","title":"Fields","default":{}},"source_urls":{"items":{"type":"string"},"type":"array","title":"Source Urls","default":[]},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"},"matches":{"items":{"type":"string"},"type":"array","title":"Matches","default":[]},"already_lead":{"type":"boolean","title":"Already Lead","default":false},"add_cost":{"type":"integer","title":"Add Cost","default":0}},"type":"object","required":["id","entity_type","display_name","resolution_state","campaign_ready"],"title":"ScoutEntityOut"},"ScoutPreviewResponse":{"properties":{"brief":{"$ref":"#/components/schemas/ScoutBrief"},"people_queries":{"items":{"type":"string"},"type":"array","title":"People Queries"},"company_queries":{"items":{"type":"string"},"type":"array","title":"Company Queries"},"reserved_credits":{"type":"integer","title":"Reserved Credits"},"max_people":{"type":"integer","title":"Max People"},"warnings":{"items":{"$ref":"#/components/schemas/PreviewWarning"},"type":"array","title":"Warnings"},"people_after_companies":{"type":"boolean","title":"People After Companies","default":false}},"type":"object","required":["brief","people_queries","company_queries","reserved_credits","max_people","warnings"],"title":"ScoutPreviewResponse"},"ScoutRunRequest":{"properties":{"target_limit":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Target Limit","default":5},"score_threshold":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Score Threshold","default":60},"extra_keywords":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":10},{"type":"null"}],"title":"Extra Keywords"},"deep_search":{"type":"boolean","title":"Deep Search","default":false},"filters":{"anyOf":[{"$ref":"#/components/schemas/SearchFilters"},{"type":"null"}]},"work_keywords":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Work Keywords"},"work_keywords_mode":{"type":"string","enum":["and","or"],"title":"Work Keywords Mode","default":"or"},"company_sizes":{"items":{"type":"string","enum":["1-10","11-50","51-200","201-500","501-1000","1001+"]},"type":"array","maxItems":6,"title":"Company Sizes"},"filter_labels":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Filter Labels"},"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"},"brief":{"anyOf":[{"$ref":"#/components/schemas/ScoutBrief"},{"type":"null"}]},"find_more":{"type":"boolean","title":"Find More","default":false}},"type":"object","title":"ScoutRunRequest"},"ScoutRunStatus":{"properties":{"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"can_run_again":{"type":"boolean","title":"Can Run Again","default":false},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"credits_used":{"type":"integer","title":"Credits Used","default":0},"stats":{"additionalProperties":true,"type":"object","title":"Stats","default":{}},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts","default":{}}},"type":"object","title":"ScoutRunStatus"},"SearchFilters":{"properties":{"location":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Location"},"company":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Company"},"past_company":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Past Company"},"school":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"School"},"industry":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Industry"},"skills":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Skills"}},"type":"object","title":"SearchFilters","description":"Structured LinkedIn people-search filters (Discovery v2, basket 1).\n\nEvery facet field carries LinkedIn *IDs* (not free text), resolved\nclient-side via the typeahead endpoint\n(``GET /api/v1/leads/discover/search-parameters``), which proxies Unipile's\n``/linkedin/search/parameters``. Sending the wrong shape (free text where an\nID is expected) is exactly what made classic search return nothing before, so\nthe model only carries IDs and the adapter drops anything it can't map.\n\nForm-supplied filters take priority over the ICP (the ICP only fills a facet\nthe form left blank — see ``lead_finder._assemble_structured_filters``).\n\nThis model is search-time facets only. Free-text \"work keywords\" + AND/OR and\nthe company-size buckets are post-fetch SOFT signals and live as separate\n``DiscoverRequest`` fields, not here (ТЗ v2 §B6/§B4).\n\n``network_distance`` is deliberately absent: discovery is pinned to 2nd + 3rd\ndegree (1st-degree is excluded — those are usually already in conversation —\nwhile 3rd-degree strangers are the target of cold outreach). ``to_filter_dict``\ninjects ``[2, 3]`` unconditionally so the rule is enforced server-side\nregardless of the client. Safe even if LinkedIn rejects degree 3 on a free\nseat: classic search then degrades to keywords-only (see\n``unipile.search_profiles``). Confirm free-seat acceptance with\n``backend/scripts/discovery_v2_spike.py`` (§E.2)."},"SearchParamOut":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"}},"type":"object","required":["id","title"],"title":"SearchParamOut"},"SendsByDay":{"properties":{"date":{"type":"string","title":"Date"},"sent":{"type":"integer","title":"Sent"},"replies":{"type":"integer","title":"Replies"}},"type":"object","required":["date","sent","replies"],"title":"SendsByDay"},"SequenceMode":{"type":"string","enum":["auto","preview","manual"],"title":"SequenceMode"},"SequenceOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"account_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Account Id"},"current_step":{"$ref":"#/components/schemas/OutreachStep"},"status":{"$ref":"#/components/schemas/SequenceStatus"},"mode":{"$ref":"#/components/schemas/SequenceMode"},"warmup_done":{"type":"boolean","title":"Warmup Done"},"next_action_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Action At"},"pause_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pause Reason"},"stopped_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stopped Reason"},"steps_done":{"type":"integer","title":"Steps Done"},"steps_total":{"type":"integer","title":"Steps Total"},"comment_posted":{"type":"boolean","title":"Comment Posted","default":false},"preview_pending":{"type":"boolean","title":"Preview Pending","default":false},"invite_accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Invite Accepted At"}},"type":"object","required":["id","lead_id","account_id","current_step","status","mode","warmup_done","next_action_at","pause_reason","stopped_reason","steps_done","steps_total"],"title":"SequenceOut"},"SequenceStatus":{"type":"string","enum":["active","paused","completed","stopped"],"title":"SequenceStatus"},"SequenceTransitionRequest":{"properties":{"action":{"type":"string","enum":["pause","resume","retry","confirm_sent","confirm_not_sent"],"title":"Action"},"reason":{"type":"string","maxLength":256,"minLength":1,"title":"Reason"}},"type":"object","required":["action","reason"],"title":"SequenceTransitionRequest"},"SequenceTransitionResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"type":"string","title":"Status"},"next_action_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Action At"},"pause_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pause Reason"}},"type":"object","required":["id","status","next_action_at","pause_reason"],"title":"SequenceTransitionResponse"},"SetCampaignFirstRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"SetCampaignFirstRequest"},"SetCampaignFirstResponse":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"campaign_first_ux":{"type":"boolean","title":"Campaign First Ux"},"campaign_first_ux_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Campaign First Ux At"}},"type":"object","required":["client_id","campaign_first_ux","campaign_first_ux_at"],"title":"SetCampaignFirstResponse"},"SetCreditsRequest":{"properties":{"balance":{"type":"integer","maximum":1000000.0,"minimum":0.0,"title":"Balance","description":"exact new balance"},"reason":{"type":"string","maxLength":512,"minLength":1,"title":"Reason"}},"type":"object","required":["balance","reason"],"title":"SetCreditsRequest"},"SetCreditsResponse":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"old_balance":{"type":"integer","title":"Old Balance"},"new_balance":{"type":"integer","title":"New Balance"},"delta":{"type":"integer","title":"Delta"},"billing_event_id":{"type":"string","format":"uuid","title":"Billing Event Id"}},"type":"object","required":["client_id","old_balance","new_balance","delta","billing_event_id"],"title":"SetCreditsResponse"},"SetDisabledRequest":{"properties":{"disabled":{"type":"boolean","title":"Disabled"},"reason":{"type":"string","maxLength":512,"minLength":1,"title":"Reason"}},"type":"object","required":["disabled","reason"],"title":"SetDisabledRequest"},"SetDisabledResponse":{"properties":{"client_id":{"type":"string","format":"uuid","title":"Client Id"},"disabled":{"type":"boolean","title":"Disabled"}},"type":"object","required":["client_id","disabled"],"title":"SetDisabledResponse"},"StartCampaignResponse":{"properties":{"started":{"type":"integer","title":"Started"},"skipped_existing":{"type":"integer","title":"Skipped Existing"},"skipped_not_new":{"type":"integer","title":"Skipped Not New","default":0},"skipped_already_contacted":{"type":"integer","title":"Skipped Already Contacted","default":0}},"type":"object","required":["started","skipped_existing"],"title":"StartCampaignResponse"},"StartConnectRequest":{"properties":{"return_to":{"type":"string","enum":["wizard","accounts"],"title":"Return To","default":"accounts"},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"}},"type":"object","title":"StartConnectRequest","description":"Activation P0 (spec §4.2): strict origin-context enum. The wizard and\nthe Accounts page share hosted auth, but the callback pages need to know\nwhere to send the user back. A closed enum — never an arbitrary URL — so\nno open redirect can be injected."},"StartConnectResponse":{"properties":{"url":{"type":"string","title":"Url"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["url","expires_at"],"title":"StartConnectResponse"},"StartPreviewPerson":{"properties":{"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"name":{"type":"string","title":"Name"},"linkedin_url":{"type":"string","title":"Linkedin Url"}},"type":"object","required":["lead_id","name","linkedin_url"],"title":"StartPreviewPerson"},"StartPreviewResponse":{"properties":{"to_start":{"items":{"$ref":"#/components/schemas/StartPreviewPerson"},"type":"array","title":"To Start"},"skipped_already_contacted":{"items":{"$ref":"#/components/schemas/StartPreviewPerson"},"type":"array","title":"Skipped Already Contacted"},"skipped_not_new":{"type":"integer","title":"Skipped Not New"}},"type":"object","required":["to_start","skipped_already_contacted","skipped_not_new"],"title":"StartPreviewResponse","description":"Who \"Start outreach\" will start, and who it will skip and why — shown in a\nconfirm step before anything is sent (Yarik 2026-10-03: a person who had\nsaid no was re-sequenced and nobody could see it coming)."},"StartSubscriptionRequest":{"properties":{"plan":{"type":"string","title":"Plan"}},"type":"object","required":["plan"],"title":"StartSubscriptionRequest"},"StartWebRunResponse":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"reserved_credits":{"type":"integer","title":"Reserved Credits"},"status":{"type":"string","title":"Status"}},"type":"object","required":["run_id","reserved_credits","status"],"title":"StartWebRunResponse"},"StatsConversion":{"properties":{"pilots_total":{"type":"integer","title":"Pilots Total"},"pilots_converted":{"type":"integer","title":"Pilots Converted"},"conversion_rate":{"type":"number","title":"Conversion Rate"}},"type":"object","required":["pilots_total","pilots_converted","conversion_rate"],"title":"StatsConversion"},"StatsPoint":{"properties":{"date":{"type":"string","title":"Date"},"new_signups":{"type":"integer","title":"New Signups"},"revenue_usd":{"type":"number","title":"Revenue Usd"},"refunds_usd":{"type":"number","title":"Refunds Usd"},"ai_cost_usd":{"type":"number","title":"Ai Cost Usd"}},"type":"object","required":["date","new_signups","revenue_usd","refunds_usd","ai_cost_usd"],"title":"StatsPoint"},"StatsTotals":{"properties":{"new_signups":{"type":"integer","title":"New Signups"},"revenue_usd":{"type":"number","title":"Revenue Usd"},"refunds_usd":{"type":"number","title":"Refunds Usd"},"ai_cost_usd":{"type":"number","title":"Ai Cost Usd"},"comped_credits":{"type":"integer","title":"Comped Credits"},"gross_margin_usd":{"type":"number","title":"Gross Margin Usd"},"ai_cost_pct_of_revenue":{"type":"number","title":"Ai Cost Pct Of Revenue"}},"type":"object","required":["new_signups","revenue_usd","refunds_usd","ai_cost_usd","comped_credits","gross_margin_usd","ai_cost_pct_of_revenue"],"title":"StatsTotals"},"StatusOut":{"properties":{"configured":{"type":"boolean","title":"Configured"},"connected":{"type":"boolean","title":"Connected"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"portal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Portal Id"},"connected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Connected At"},"last_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync At"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"last_error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error Code"},"contacts_synced":{"type":"integer","title":"Contacts Synced","default":0},"companies_synced":{"type":"integer","title":"Companies Synced","default":0},"allowed":{"type":"boolean","title":"Allowed","default":true},"upgrade_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Upgrade To"},"paused":{"type":"boolean","title":"Paused","default":false},"needs_reconnect":{"type":"boolean","title":"Needs Reconnect","default":false},"deal_pipeline_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal Pipeline Id"},"deal_stage_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal Stage Id"},"deals_created":{"type":"integer","title":"Deals Created","default":0}},"type":"object","required":["configured","connected"],"title":"StatusOut"},"StopSequenceRequest":{"properties":{"reason":{"type":"string","maxLength":256,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"StopSequenceRequest"},"StopSequenceResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"type":"string","title":"Status"},"stopped_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stopped Reason"}},"type":"object","required":["id","status","stopped_reason"],"title":"StopSequenceResponse"},"SubscriptionPlan":{"type":"string","enum":["solo","starter","growth","scale"],"title":"SubscriptionPlan"},"SuggestionOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"run_id":{"type":"string","format":"uuid","title":"Run Id"},"linkedin_url":{"type":"string","title":"Linkedin Url"},"name":{"type":"string","title":"Name"},"title":{"type":"string","title":"Title"},"company":{"type":"string","title":"Company"},"location":{"type":"string","title":"Location"},"source_query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Query"},"relevance_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Relevance Score"},"relevance_reasoning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relevance Reasoning"},"matched_filters":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Matched Filters"},"language_matches":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Language Matches"},"mini_bio":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mini Bio"},"company_size":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Size"},"company_match":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Match"},"intent_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Intent Score"},"intent_reasons":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Intent Reasons"},"intent_signals":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Intent Signals"},"no_current_role":{"type":"boolean","title":"No Current Role","default":false},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"decided_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Decided At"},"accepted_lead_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Accepted Lead Id"}},"type":"object","required":["id","run_id","linkedin_url","name","title","company","location","source_query","relevance_score","relevance_reasoning","status","created_at","decided_at","accepted_lead_id"],"title":"SuggestionOut"},"SystemHealth":{"properties":{"db_ok":{"type":"boolean","title":"Db Ok"},"db_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Db Latency Ms"},"total_clients":{"type":"integer","title":"Total Clients"},"total_leads":{"type":"integer","title":"Total Leads"},"total_sequences":{"type":"integer","title":"Total Sequences"},"total_messages":{"type":"integer","title":"Total Messages"},"active_sequences":{"type":"integer","title":"Active Sequences"},"paused_sequences":{"type":"integer","title":"Paused Sequences"}},"type":"object","required":["db_ok","db_latency_ms","total_clients","total_leads","total_sequences","total_messages","active_sequences","paused_sequences"],"title":"SystemHealth"},"TokenPair":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token","default":""},"token_type":{"type":"string","title":"Token Type","default":"bearer"}},"type":"object","required":["access_token"],"title":"TokenPair"},"TotpConfirmRequest":{"properties":{"code":{"type":"string","maxLength":6,"minLength":6,"title":"Code"}},"type":"object","required":["code"],"title":"TotpConfirmRequest"},"TotpSetupResponse":{"properties":{"secret":{"type":"string","title":"Secret"},"provisioning_uri":{"type":"string","title":"Provisioning Uri"}},"type":"object","required":["secret","provisioning_uri"],"title":"TotpSetupResponse"},"UpdateAccountRequest":{"properties":{"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"invite_pace":{"anyOf":[{"type":"string","enum":["safe","faster"]},{"type":"null"}],"title":"Invite Pace"},"send_hour_start":{"anyOf":[{"type":"integer","maximum":23.0,"minimum":0.0},{"type":"null"}],"title":"Send Hour Start"},"send_hour_end":{"anyOf":[{"type":"integer","maximum":24.0,"minimum":1.0},{"type":"null"}],"title":"Send Hour End"},"send_days":{"anyOf":[{"items":{"type":"integer"},"type":"array","maxItems":31},{"type":"null"}],"title":"Send Days"}},"type":"object","title":"UpdateAccountRequest","description":"Editable per-account settings: the IANA timezone (Task 4, Alembic 037),\nthe invite pace (2026-09-28, Alembic 058) and the sending window\n(2026-10-06, Alembic 065). Send any subset; the window's three fields are\nvalidated together against the stored values."},"UpdateAffiliateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"contact_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Contact Email"},"commission_rate_percent":{"anyOf":[{"type":"number","maximum":100.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Commission Rate Percent"},"commission_duration_months":{"anyOf":[{"type":"integer","maximum":120.0,"minimum":1.0},{"type":"null"}],"title":"Commission Duration Months"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"},"note":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Note"}},"type":"object","title":"UpdateAffiliateRequest"},"UpdateLeadRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"},"company":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Company"},"location":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Location"}},"type":"object","title":"UpdateLeadRequest"},"UpdateMeRequest":{"properties":{"company_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Company Name"},"current_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Password"},"new_password":{"anyOf":[{"type":"string","maxLength":128,"minLength":12},{"type":"null"}],"title":"New Password"},"outreach_auto_send":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Outreach Auto Send"},"languages":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":20},{"type":"null"}],"title":"Languages"},"ui_tour_state":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Ui Tour State"},"avg_deal_size_usd":{"anyOf":[{"type":"number","maximum":1000000000.0,"minimum":0.0},{"type":"null"}],"title":"Avg Deal Size Usd"}},"type":"object","title":"UpdateMeRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VoicePreviewInput":{"properties":{"company_pitch":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Company Pitch"},"target_persona":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Target Persona"},"tone_prefs":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Tone Prefs"},"website_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Website Url"},"tone_samples":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":10},{"type":"null"}],"title":"Tone Samples"},"language":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Language"}},"type":"object","title":"VoicePreviewInput","description":"Wizard 2.3 preview body: the business inputs (lenient, same backfill as\n/generate-icp) plus the voice the user is typing RIGHT NOW.\n\n``tone_samples`` mirrors :class:`ExtractVoiceRequest`'s bounds (≤10 items,\n≤5000 chars each) so the same paste can't be accepted here and rejected\nthere — and so the prompt stays bounded regardless of what is pasted."},"WizardAdvanceRequest":{"properties":{"step":{"type":"string","title":"Step","description":"Legacy: business|icp|linkedin|discover|done. Campaign-first (v2): connect_linkedin|create_campaign|done — discovery is no longer an onboarding step."},"first_discovery_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"First Discovery Run Id"},"first_campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"First Campaign Id"},"dismiss":{"type":"boolean","title":"Dismiss","default":false}},"type":"object","required":["step"],"title":"WizardAdvanceRequest"},"WizardSkipRequest":{"properties":{"step":{"type":"string","title":"Step","description":"Legacy: 'linkedin' or 'discover'. Campaign-first (v2): only 'connect_linkedin'."},"reason":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Reason"}},"type":"object","required":["step"],"title":"WizardSkipRequest"},"WizardStateOut":{"properties":{"step":{"type":"string","title":"Step"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"first_discovery_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Discovery Run Id"},"skipped":{"additionalProperties":{"type":"string"},"type":"object","title":"Skipped"},"source":{"type":"string","title":"Source"},"first_campaign_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Campaign Id"},"all_steps":{"items":{"type":"string"},"type":"array","title":"All Steps"}},"type":"object","required":["step","source"],"title":"WizardStateOut","description":"Response shape for the wizard endpoints.\n\nMirrors :class:`app.services.onboarding_wizard.WizardState` but\ndeclared here so FastAPI can generate the OpenAPI schema without\nimporting the dataclass."},"WorkflowRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"client_id":{"type":"string","format":"uuid","title":"Client Id"},"client_email":{"type":"string","title":"Client Email"},"lead_id":{"type":"string","format":"uuid","title":"Lead Id"},"lead_name":{"type":"string","title":"Lead Name"},"status":{"type":"string","title":"Status"},"current_step":{"type":"string","title":"Current Step"},"next_action_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Action At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"account_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Label"},"pause_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pause Reason"}},"type":"object","required":["id","client_id","client_email","lead_id","lead_name","status","current_step","next_action_at","updated_at","account_label","pause_reason"],"title":"WorkflowRow"},"WorkflowSummary":{"properties":{"active":{"type":"integer","title":"Active"},"paused":{"type":"integer","title":"Paused"},"completed":{"type":"integer","title":"Completed"},"stopped":{"type":"integer","title":"Stopped"},"stalled_over_24h":{"type":"integer","title":"Stalled Over 24H"}},"type":"object","required":["active","paused","completed","stopped","stalled_over_24h"],"title":"WorkflowSummary"},"app__api__integrations_hubspot__ConnectOut":{"properties":{"authorize_url":{"type":"string","title":"Authorize Url"}},"type":"object","required":["authorize_url"],"title":"ConnectOut"},"app__api__mailboxes__ConnectOut":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"ConnectOut"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}