{"openapi":"3.1.0","info":{"title":"Explee API","description":"Explee API Service","version":"1.0.0"},"paths":{"/api/internal/logto/sync":{"post":{"tags":["Auth"],"summary":"Sync Events","operationId":"sync_events_api_internal_logto_sync_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/logto/consistency/tick":{"post":{"tags":["Auth"],"summary":"Auth Consistency Tick","operationId":"auth_consistency_tick_api_internal_logto_consistency_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Auth Consistency Tick Api Internal Logto Consistency Tick Post"}}}}}}},"/api/logto/webhook":{"post":{"tags":["Auth"],"summary":"Logto Webhook","operationId":"logto_webhook_api_logto_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/health/deep":{"get":{"summary":"Health Check Deep","operationId":"health_check_deep_api_health_deep_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"head":{"summary":"Health Check Deep","operationId":"health_check_deep_api_health_deep_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/alerts/security-probe/tick":{"post":{"summary":"Security Probe Tick","description":"Single pass; see ``api.alerts.security_probe.run_security_probe_checks``.","operationId":"security_probe_tick_api_internal_alerts_security_probe_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Security Probe Tick Api Internal Alerts Security Probe Tick Post"}}}}}}},"/api/internal/alerts/sandbox-health/tick":{"post":{"summary":"Sandbox Health Tick","description":"Single pass; see ``api.alerts.sandbox_health.detect_sandbox_infra_failures``.","operationId":"sandbox_health_tick_api_internal_alerts_sandbox_health_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Sandbox Health Tick Api Internal Alerts Sandbox Health Tick Post"}}}}}}},"/api/internal/alerts/attachment-health/tick":{"post":{"summary":"Attachment Health Tick","description":"Single pass; see ``api.alerts.attachment_health.detect_attachment_health``.","operationId":"attachment_health_tick_api_internal_alerts_attachment_health_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Attachment Health Tick Api Internal Alerts Attachment Health Tick Post"}}}}}}},"/api/agents/tasks":{"get":{"tags":["Agents"],"summary":"List Tasks","operationId":"list_tasks_api_agents_tasks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTasksResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Agents"],"summary":"Create Task","operationId":"create_task_api_agents_tasks_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/tasks/{task_id}":{"get":{"tags":["Agents"],"summary":"Get Task","operationId":"get_task_api_agents_tasks__task_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskSnapshotResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/tasks/{task_id}/dataset":{"patch":{"tags":["Agents"],"summary":"Patch Task Dataset","operationId":"patch_task_dataset_api_agents_tasks__task_id__dataset_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDatasetRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskSnapshotResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/tasks/{task_id}/rows/delete-all":{"post":{"tags":["Agents"],"summary":"Delete All Task Rows","operationId":"delete_all_task_rows_api_agents_tasks__task_id__rows_delete_all_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskSnapshotResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/tasks/{task_id}/rows/{row_id}":{"delete":{"tags":["Agents"],"summary":"Delete Task Row","operationId":"delete_task_row_api_agents_tasks__task_id__rows__row_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskSnapshotResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/agents/sync":{"post":{"tags":["Agents"],"summary":"Sync Running Runs","description":"Reconcile stale agent runs. Called by Kubernetes CronJob.\nInternal endpoint, no auth (relies on cluster-internal access).\n\nTwo passes:\n1. Re-dispatch stale 'pending' runs — messages lost during worker restart\n   (Dramatiq acks on receive, so restarts lose in-flight messages).\n2. Timeout stale 'running' runs — worker crash without Shutdown handler.","operationId":"sync_running_runs_api_internal_agents_sync_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/agents/runs":{"post":{"tags":["Agents"],"summary":"Start Run","operationId":"start_run_api_agents_runs_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__agent__router__StartRunRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/runs/{job_id}":{"get":{"tags":["Agents"],"summary":"Get Run Status","operationId":"get_run_status_api_agents_runs__job_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/draft/{agent_id}":{"get":{"tags":["Agents"],"summary":"Get Agent Draft","description":"Return a draft TaskSnapshot for the agent (no DB write). Built from example_csv.","operationId":"get_agent_draft_api_agents_draft__agent_id__get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskSnapshotResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/list":{"get":{"tags":["Agents"],"summary":"List Agents","operationId":"list_agents_api_agents_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAgentsResponse"}}}}}}},"/api/agent-chat/sessions":{"post":{"tags":["Agent Chat"],"summary":"Start Session","description":"Create a new agent chat session for a segment.","operationId":"start_session_api_agent_chat_sessions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSessionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/sessions/active":{"get":{"tags":["Agent Chat"],"summary":"Get Active Session For Segment","description":"Return the latest non-terminal session for ``segment_id``, or null.\n\nThe frontend calls this on mount of the segment workspace so that\nrefreshing the page reconnects to an in-flight agent session instead\nof showing the IDLE state. Ownership is verified via segment→project→org.","operationId":"get_active_session_for_segment_api_agent_chat_sessions_active_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"query","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/sessions/{session_id}":{"get":{"tags":["Agent Chat"],"summary":"Get Session","description":"Metadata + last_seq for client reconnect/init.\n\nClients call this once on page load, then open /stream?since=<last_seq>.\nThe `segment` object carries the segment-level lifecycle (status + paused\n+ phase_entered_at) so the UI can render the status pill and input\nplaceholder before the first SSE event arrives.","operationId":"get_session_api_agent_chat_sessions__session_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/segments/{segment_id}":{"get":{"tags":["Agent Chat"],"summary":"Get Segment Lifecycle Endpoint","description":"Return the segment's lifecycle snapshot. Used by the UI to render the\nstatus pill and pause button BEFORE any agent session exists.","operationId":"get_segment_lifecycle_endpoint_api_agent_chat_segments__segment_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/segments/{segment_id}/pause":{"post":{"tags":["Agent Chat"],"summary":"Pause Segment Endpoint","description":"Pause sending by transitioning `outreach → listening`.\n\nOnly legal from `outreach`. Other statuses return 409 — the frontend\ngates the button on status so this is a safety net for direct API callers.\nAfter the transition we also flip the session stop flag so any live\nsub-agent on this segment halts on the next ~5s poll tick.","operationId":"pause_segment_endpoint_api_agent_chat_segments__segment_id__pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/segments/{segment_id}/resume":{"post":{"tags":["Agent Chat"],"summary":"Resume Segment Endpoint","description":"Resume a paused Campaign through the shared start orchestration.\n\nOnly legal from `listening`. If targeting changed while paused, this moves\nthe Campaign back to discovery and enqueues Retarget before any old\noutreach can resume; otherwise it resumes the prior lifecycle normally.\n\nRefuses with 402 when the org can't afford even one more email — same\n`Email Affordability Gate` the sender-worker `_precheck` and\nPOST `/api/app-auto-gtm/segments/{id}/launch` already share. Without\nthis check, resuming a debt-paused or empty-wallet campaign would\nimmediately stall again on the per-send precheck.","operationId":"resume_segment_endpoint_api_agent_chat_segments__segment_id__resume_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/segments/{segment_id}/stop":{"post":{"tags":["Agent Chat"],"summary":"Stop Segment Endpoint","description":"Reliably STOP a campaign **regardless of status** — unlike /pause, which\nis outreach-only and 409s for discovery/searching/review (leaving the\ncampaign to autonomously search → review → auto-approve → send).\n\nHalts everything that could still cause a send, idempotently:\n  1. interrupt any running agent turn (discovery/searching/review/resuming)\n     so the lead search / review work stops;\n  2. if it's actively sending (outreach) → pause (→ listening) and cancel\n     the queued outreach emails;\n  3. freeze any pending review's auto-approve countdown so a review segment\n     can't tick over into outreach.\n\nSafe to call from any status and repeatedly. Re-enable via /start.\n\nThin adapter: the orchestration lives in segment_control.stop_campaign\n(shared with the public API); this endpoint only translates the cookie\nsession into an org_id and maps domain errors to HTTP.","operationId":"stop_segment_endpoint_api_agent_chat_segments__segment_id__stop_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/segments/{segment_id}/start":{"post":{"tags":["Agent Chat"],"summary":"Start Segment Endpoint","description":"Re-enable a campaign that was stopped via /stop — the status-aware\ninverse, so a re-checked campaign actually resumes whatever it was doing:\n  • listening  → resume (→ outreach), gated by the affordability check;\n  • review     → un-freeze the auto-approve countdown (fresh window);\n  • discovery  → re-kick the discovery pipeline (idempotent).\nAlready-running (outreach) / terminal (archived) / error → no-op.\n\nThin adapter: the orchestration lives in segment_control.start_campaign\n(shared with the public API); this endpoint only translates the cookie\nsession into an org_id and maps domain errors to HTTP.","operationId":"start_segment_endpoint_api_agent_chat_segments__segment_id__start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/segments/{segment_id}/transition":{"post":{"tags":["Agent Chat"],"summary":"Transition Segment Endpoint","description":"Explicit transition, e.g. the 'Start campaign' button flipping\nreview → outreach. Invalid transitions return 409.\n\nTransitions *into* `outreach` (from `review` or `listening`) are\ngated by the same `Email Affordability Gate` used in /resume and\n/launch — entering the sending state with no funds would just\nstall on the first per-send precheck. Other targets (e.g.\ncancellation paths) pass through unchanged.","operationId":"transition_segment_endpoint_api_agent_chat_segments__segment_id__transition_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransitionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/segments/{segment_id}/archive":{"post":{"tags":["Agent Chat"],"summary":"Archive Segment Endpoint","description":"Archive a campaign from ANY live status — makes it inert everywhere\n(no sending, no enqueue, no autopilot replies, no budget/priority share,\nretro leaves it alone) and hides it from the sidebar. Reversible via\n/unarchive. Interrupts any live agent turn first, like /stop.","operationId":"archive_segment_endpoint_api_agent_chat_segments__segment_id__archive_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/segments/{segment_id}/unarchive":{"post":{"tags":["Agent Chat"],"summary":"Unarchive Segment Endpoint","description":"Restore an archived campaign back to Paused (`listening`).\n\nLands in Paused deliberately — the user re-Starts it explicitly, so restore\nnever silently resumes sending or spend. Auto-reply stays off (re-enable via\nPATCH /segments/{id}). Returns 409 if the segment isn't archived.","operationId":"unarchive_segment_endpoint_api_agent_chat_segments__segment_id__unarchive_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/segments/{segment_id}/review":{"get":{"tags":["Agent Chat"],"summary":"Get Review Endpoint","description":"Snapshot of the segment's current review state — the same shape as\nthe ``review.updated`` SSE payload. Used by the frontend on mount to\nrender the ReviewControl before the first SSE event arrives.","operationId":"get_review_endpoint_api_agent_chat_segments__segment_id__review_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Agent Chat"],"summary":"Post Review Action Endpoint","description":"Approve / reject / cancel-auto-approve the current review attempt.\n\n* ``approve``           → transition segment → outreach, finalize row.\n* ``reject``            → archive row with feedback, transition segment\n                          → discovery, enqueue a re-run turn on the\n                          latest session carrying the wrapped prompt.\n                          At MAX_REJECTS the segment stays in review\n                          with auto-approve disabled and no new turn is\n                          kicked — the UI blocks further rejections.\n* ``cancel_auto_approve`` → idempotent: freeze the countdown.","operationId":"post_review_action_endpoint_api_agent_chat_segments__segment_id__review_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewActionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/sessions/{session_id}/input":{"post":{"tags":["Agent Chat"],"summary":"Post Input","description":"Typed user input — message | command | interrupt.\n\nFire-and-forget at the HTTP layer. The Claude CLI runs in the dramatiq\n`agent_chat_turn` actor; the caller consumes the resulting events via\nGET /sessions/{id}/stream. Returns 202 on accept.","operationId":"post_input_api_agent_chat_sessions__session_id__input_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/MessageInput"},{"$ref":"#/components/schemas/CommandInput"},{"$ref":"#/components/schemas/InterruptInput"}],"discriminator":{"propertyName":"kind","mapping":{"message":"#/components/schemas/MessageInput","command":"#/components/schemas/CommandInput","interrupt":"#/components/schemas/InterruptInput"}},"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/sessions/{session_id}/events":{"get":{"tags":["Agent Chat"],"summary":"Get Events","description":"Poll-transport read of the event bus: events with seq > `since`.\n\nReplaces the held-SSE `/stream` for the web client (T-907): a held stream\ncost one connection per open tab plus a server-side 250ms DB poll for its\nlifetime, while this endpoint costs one read per client poll tick.\n\nReturns one `read_page` page (500 raw rows): `next_since` is the raw-scan\nwatermark the client resumes from (advances even across retired-kind\nstretches the filter drops), `has_more=True` tells it to re-poll\nimmediately instead of waiting a full interval, so a long history replays\nin a fast page loop.","operationId":"get_events_api_agent_chat_sessions__session_id__events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"since","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Since"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/sessions/{session_id}/artifacts":{"get":{"tags":["Agent Chat"],"summary":"List Session Artifacts","description":"List all artifacts for a session.","operationId":"list_session_artifacts_api_agent_chat_sessions__session_id__artifacts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/artifacts/{short_id}":{"get":{"tags":["Agent Chat"],"summary":"Get Artifact","description":"Get artifact data by short_id.\n\nWithout `offset`/`limit` returns the full content (backward compat with\ncallers that haven't migrated to pagination). When both are provided\n(typical UI flow for large tabular artifacts — `people` can be 20k+ rows),\nreturns only the requested slice.\n\nReads from the parquet/md file referenced by ``artifact.path`` when\npresent; falls back to the legacy ``data`` JSONB for artifacts written\nbefore the file-based refactor.\n\n``people`` artifacts store only ``person_id`` in the file (an\nintermediate pointer, not the display row) — hydrated into the product\npeople-row shape via ClickHouse before returning, same dispatch as the\nplayground endpoint. Without it every people table renders with the\nright row count but no name/company/title/email in any cell.","operationId":"get_artifact_api_agent_chat_artifacts__short_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"short_id","in":"path","required":true,"schema":{"type":"string","title":"Short Id"}},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/agent-chat/reaper/run":{"post":{"tags":["Agent Chat"],"summary":"Reaper Run","description":"Single reaper + retry pass.\n\nOrdering is load-bearing: reaper writes death certificates for stalled\nturns (synthetic ``agent.turn_ended`` + ``subagent.finished{error}``),\nthen retry picks up freshly-failed sub-agent runs (both reaper-written\nAND self-failed) and re-enqueues ``continue``. Running them sequentially\non the same HTTP request guarantees retry sees the reaper's writes\nwithout a 60s inter-tick gap. See ``api/agent_chat/reaper.py`` and\n``api/agent_chat/retry.py`` for the per-pass contracts.","operationId":"reaper_run_api_internal_agent_chat_reaper_run_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Reaper Run Api Internal Agent Chat Reaper Run Post"}}}}}}},"/api/internal/agent-chat/alerts/dispatch_errors":{"post":{"tags":["Agent Chat"],"summary":"Alerts Dispatch Errors","description":"Single pass; see ``api.agent_chat.alert_dispatcher.dispatch_pending_errors``.","operationId":"alerts_dispatch_errors_api_internal_agent_chat_alerts_dispatch_errors_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Alerts Dispatch Errors Api Internal Agent Chat Alerts Dispatch Errors Post"}}}}}}},"/api/internal/agent-chat/subscription/probe":{"post":{"tags":["Agent Chat"],"summary":"Subscription Probe","description":"Health tick: read agents.d usage, size the turn queue, post alerts.","operationId":"subscription_probe_api_internal_agent_chat_subscription_probe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Subscription Probe Api Internal Agent Chat Subscription Probe Post"}}}}}}},"/api/agent-chat/playground/catalog":{"get":{"tags":["Agent Chat Playground"],"summary":"Get Catalog","description":"Static catalog data — refreshed on every call so a code change to a\nsub-agent's ``SYSTEM`` prompt or to ``mcp_configs.SUBAGENT_TOOLS`` lands\non the next browser reload without restarting the worker.","operationId":"get_catalog_api_agent_chat_playground_catalog_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/playground/runs":{"post":{"tags":["Agent Chat Playground"],"summary":"Start Run","operationId":"start_run_api_agent_chat_playground_runs_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__agent_chat__playground__router__StartRunRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/playground/runs/{run_id}/stop":{"post":{"tags":["Agent Chat Playground"],"summary":"Stop Run","description":"Best-effort stop via the same DB flag the worker polls.","operationId":"stop_run_api_agent_chat_playground_runs__run_id__stop_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/playground/runs/{run_id}/input":{"post":{"tags":["Agent Chat Playground"],"summary":"Post Run Input","description":"Follow-up turn on an existing playground run.\n\nMirrors the message branch of ``POST /api/agent-chat/sessions/{id}/input``\nbut bypasses the MOA router preprocessor — the playground enqueues a\ndirect sub-agent turn in the dramatiq worker.\n\n``message`` enqueues a follow-up turn. ``command=resume`` enqueues the\nsame continuation prompt the product chat uses after a stopped/error\nstate. Other commands are intentionally unsupported in this direct\nsub-agent surface.","operationId":"post_run_input_api_agent_chat_playground_runs__run_id__input_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/MessageInput"},{"$ref":"#/components/schemas/CommandInput"},{"$ref":"#/components/schemas/InterruptInput"}],"discriminator":{"propertyName":"kind","mapping":{"message":"#/components/schemas/MessageInput","command":"#/components/schemas/CommandInput","interrupt":"#/components/schemas/InterruptInput"}},"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/playground/runs/{run_id}":{"get":{"tags":["Agent Chat Playground"],"summary":"Get Run Meta","operationId":"get_run_meta_api_agent_chat_playground_runs__run_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/playground/runs/{run_id}/events":{"get":{"tags":["Agent Chat Playground"],"summary":"Get Run Events","description":"Poll-transport mirror of ``/sessions/:id/events`` (T-907) — same\ncontract, same reason: the chat lib polls instead of holding SSE.","operationId":"get_run_events_api_agent_chat_playground_runs__run_id__events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"since","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Since"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/playground/runs/{run_id}/artifacts":{"get":{"tags":["Agent Chat Playground"],"summary":"List Run Artifacts","description":"List artifacts for a playground run. Same shape as\n``/sessions/:id/artifacts`` so the chat lib's renderer Just Works.","operationId":"list_run_artifacts_api_agent_chat_playground_runs__run_id__artifacts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/playground/runs/{run_id}/files":{"get":{"tags":["Agent Chat Playground"],"summary":"List Run Files","description":"List every file the agent left in its workdir.\n\nReturned shape is ``{path, size, mtime, format, openable}`` — the UI\nrenders all entries as cards but only enables the open action for those\nwhose ``format`` is one we can hand to the ArtifactViewer (``parquet``\nor ``markdown``).","operationId":"list_run_files_api_agent_chat_playground_runs__run_id__files_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/playground/runs/{run_id}/files-csv/{file_path}":{"get":{"tags":["Agent Chat Playground"],"summary":"Download Run File As Csv","description":"Download a workdir parquet as CSV (first 1000 rows).\n\nSibling of ``/runs/{run_id}/files/{file_path:path}`` but on a separate\nprefix so the FastAPI ``{file_path:path}`` matcher doesn't have to\ndisambiguate between the JSON-paginated read and the CSV download.","operationId":"download_run_file_as_csv_api_agent_chat_playground_runs__run_id__files_csv__file_path__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"file_path","in":"path","required":true,"schema":{"type":"string","title":"File Path"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/playground/runs/{run_id}/files/{file_path}":{"get":{"tags":["Agent Chat Playground"],"summary":"Read Run File","description":"Read one file from the workdir.\n\nReturns an ArtifactApiResponse-shaped payload so the existing\nArtifactViewer can render it directly (table for parquet, markdown for\n.md). Pagination args mirror ``/playground/artifacts/{short_id}`` —\nsame caps, same semantics — so the FilesPanel wiring is symmetric\nbetween files and persisted artifacts. 415 for unsupported\nextensions; 404 for missing files; 400 for path-traversal attempts.","operationId":"read_run_file_api_agent_chat_playground_runs__run_id__files__file_path__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"file_path","in":"path","required":true,"schema":{"type":"string","title":"File Path"}},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/playground/artifacts/{short_id}":{"get":{"tags":["Agent Chat Playground"],"summary":"Get Run Artifact","description":"Auth-gated mirror of ``GET /api/agent-chat/artifacts/:short_id``.\n\nSupports the same ``?offset=&limit=`` pagination as the prod endpoint —\nthe shared ArtifactViewer pages large tabular artifacts (e.g. 20k people\nrows) and POSTs the page through this URL.\n\nReads from the parquet/markdown file referenced by ``artifact.path``\nwhen present (post-898f9be8 file-based artifacts) and falls back to\nthe legacy ``data`` JSONB for rows written before the refactor. Without\nthis dispatch, every file-backed artifact in the playground viewer\ncame back with ``data=[]`` and rendered as \"No data\".\n\nWe don't try to enforce session→artifact ownership here because the\nshort_id is already an unguessable random string and the call is gated\nbehind the playground auth dependency. Anyone with both the URL secret\nAND a valid Explee token can read; that's the whole privacy model for\nthis surface.","operationId":"get_run_artifact_api_agent_chat_playground_artifacts__short_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"short_id","in":"path","required":true,"schema":{"type":"string","title":"Short Id"}},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-chat/playground/artifacts/{short_id}/csv":{"get":{"tags":["Agent Chat Playground"],"summary":"Download Run Artifact As Csv","description":"Download an artifact as CSV (first 1000 rows).\n\nReuses the same data path as ``GET /artifacts/{short_id}`` — read the\nfile-backed parquet (or legacy ``data`` JSONB), hydrate ``people``\nrows the same way the viewer sees them, then encode as CSV. Markdown\nartifacts and other non-tabular formats return 415; the UI hides the\nbutton for them anyway.","operationId":"download_run_artifact_as_csv_api_agent_chat_playground_artifacts__short_id__csv_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"short_id","in":"path","required":true,"schema":{"type":"string","title":"Short Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/email/webhook":{"post":{"tags":["Email"],"summary":"Send Email","operationId":"send_email_api_email_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/email/inbound":{"post":{"tags":["Email"],"summary":"Receive Inbound","description":"Resend Inbound (\"email.received\") webhook: founder mail first, then the\noutreach reply relay, then the log-only probe.\n\nFails closed: the signing secret must be set, and the signature must verify\n(both real consumers act on the content, so an unverified body is untrusted).\n``retry: True`` from founder mail → 503 so Resend redelivers (nothing stored,\nthe retry isn't deduped away).","operationId":"receive_inbound_api_email_inbound_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/email/unsubscribe":{"get":{"tags":["Email"],"summary":"Email Unsubscribe Page","description":"Hosted confirm page for clients without One-Click support.","operationId":"email_unsubscribe_page_api_email_unsubscribe_get","parameters":[{"name":"e","in":"query","required":false,"schema":{"type":"string","default":"","title":"E"}},{"name":"sig","in":"query","required":false,"schema":{"type":"string","default":"","title":"Sig"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Email"],"summary":"Email Unsubscribe Confirm","description":"Process unsubscribe — RFC 8058 One-Click POST or the confirm form.","operationId":"email_unsubscribe_confirm_api_email_unsubscribe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/slack/interact":{"post":{"tags":["Slack"],"summary":"Slack Interact","description":"Slack Interactivity endpoint. All within Slack's 3s budget:\n`✉️ Reply` → open modal · modal submit → draft into thread · `Send` → email.","operationId":"slack_interact_api_slack_interact_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/track/sync":{"post":{"tags":["Analytics"],"summary":"Sync Events","operationId":"sync_events_api_track_sync_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/track":{"post":{"tags":["Analytics"],"summary":"Track Amplitude","description":"Proxy events to Amplitude with server-side enrichment.\n\nConvergence point for the FE Amplitude SDK (web/, autogtm/front/) and\nserver-side ``proxy.ts`` middleware. Backend Python emitters call\n``api.analytics.track:track()`` directly — same enrichment, same row\nshape, no HTTP loopback.","operationId":"track_amplitude_api_track_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventBatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/capi":{"post":{"tags":["Analytics"],"summary":"Meta Capi Relay","description":"Relay a browser-fired Meta Pixel event to the Conversions API, sharing the\nPixel's ``event_id`` so Meta dedups the two copies into one.\n\nForward-only: enriches with server IP / User-Agent and ``external_id`` (the\ndevice id) but does NOT persist anything — ``guest_user.ext_ids`` is written\nvia the checkout attribution flow. Runs in a background task so the funnel\nnever blocks on Meta, and ``send_capi_event`` is a no-op without Meta creds.","operationId":"meta_capi_relay_api_capi_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapiEvent"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/apply":{"post":{"tags":["Jobs"],"summary":"Apply","operationId":"apply_api_jobs_apply_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/test-task":{"post":{"tags":["Jobs"],"summary":"Test Task","operationId":"test_task_api_jobs_test_task_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSubmissionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/balance":{"get":{"tags":["Billing"],"summary":"Balance","operationId":"balance_api_billing_balance_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/packages":{"get":{"tags":["Billing"],"summary":"Get Packages","operationId":"get_packages_api_billing_packages_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/billing/upgrade":{"post":{"tags":["Billing"],"summary":"Upgrade","operationId":"upgrade_api_billing_upgrade_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradePayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/subscription":{"get":{"tags":["Billing"],"summary":"Get Subscription","operationId":"get_subscription_api_billing_subscription_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/invoices":{"get":{"tags":["Billing"],"summary":"List Invoices","description":"Every invoice created in one UTC calendar month, for the Transactions panel.\n\nThe default view («Recent», the 20 newest) rides on ``/subscription`` —\nthis endpoint only answers a chosen month, so the page never lists the\nsame invoices twice.","operationId":"list_invoices_api_billing_invoices_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"month","in":"query","required":true,"schema":{"type":"string","title":"Month"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/invoices/download":{"get":{"tags":["Billing"],"summary":"Download Invoices","description":"One zip with the PDFs of exactly the invoices the panel lists for ``month``.\n\nStripe's ``invoice_pdf`` links are signed and public, so the api just pulls\nthem (a few at a time) and zips them in memory — a month of invoices is a\nhandful of ~50 KB files, nothing to stream. One dead link does not sink the\nbatch: that invoice is skipped and logged; only an all-dead batch is an error.","operationId":"download_invoices_api_billing_invoices_download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Month"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/portal":{"get":{"tags":["Billing"],"summary":"Portal","operationId":"portal_api_billing_portal_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/checkout":{"post":{"tags":["Billing"],"summary":"Checkout","operationId":"checkout_api_billing_checkout_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/coupon/redeem":{"post":{"tags":["Billing"],"summary":"Redeem Coupon","operationId":"redeem_coupon_api_billing_coupon_redeem_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponRedeemPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/stripe/webhook":{"post":{"tags":["Billing"],"summary":"Stripe Webhook","operationId":"stripe_webhook_api_billing_stripe_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/billing/activity/transactions":{"get":{"tags":["Billing"],"summary":"Get Activity Transactions","description":"Get organization's credit transactions for the specified period.\nOnly accessible by organization admins and owners.\n\nQuery parameters:\n- start_date: Start date in ISO format (e.g., '2024-01-01T00:00:00Z').\n              Defaults to 30 days ago if not provided.\n- end_date: End date in ISO format (e.g., '2024-01-31T23:59:59Z').\n            Defaults to current time if not provided.\n\nNote: Date range is automatically limited to a maximum of 90 days.\nIf a larger range is requested, start_date will be adjusted to 90 days before end_date.","operationId":"get_activity_transactions_api_billing_activity_transactions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/activity/order/{order_id}/breakdown":{"get":{"tags":["Billing"],"summary":"Get Order Breakdown","description":"Get detailed breakdown for a specific order.\nOnly accessible by organization admins and owners.","operationId":"get_order_breakdown_api_billing_activity_order__order_id__breakdown_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leads/pricing":{"get":{"tags":["Export"],"summary":"Leads Pricing","operationId":"leads_pricing_api_leads_pricing_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leads/pricing/calculate":{"get":{"tags":["Export"],"summary":"Leads Pricing Calculate","operationId":"leads_pricing_calculate_api_leads_pricing_calculate_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"leads_requested","in":"query","required":true,"schema":{"type":"integer","title":"Leads Requested"}},{"name":"linkedin","in":"query","required":false,"schema":{"anyOf":[{"const":"basic","type":"string"},{"type":"null"}],"title":"Linkedin"}},{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"enum":["basic","premium"],"type":"string"},{"type":"null"}],"title":"Email"}},{"name":"phone","in":"query","required":false,"schema":{"anyOf":[{"enum":["basic","basic_new","premium"],"type":"string"},{"type":"null"}],"title":"Phone"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leads/export/{lead_export_id}":{"get":{"tags":["Export"],"summary":"Leads Export Results","operationId":"leads_export_results_api_leads_export__lead_export_id__get","parameters":[{"name":"lead_export_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Export Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leads/exports":{"get":{"tags":["Export"],"summary":"Get Leads Exports","operationId":"get_leads_exports_api_leads_exports_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":100,"title":"Page Size"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leads/export":{"post":{"tags":["Export"],"summary":"Start Leads Export","operationId":"start_leads_export_api_leads_export_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadsExportPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/flows/reap-orphans":{"post":{"tags":["Flows"],"summary":"Reap Orphans Endpoint","description":"Cron-only: crash flow runs stuck in RUNNING past their own flow's\ntimeout x retries envelope + alert #alerts (T-1305).\n\nInternal endpoint. Called by the `prefect-orphan-reaper` CronJob every\n15 minutes. Idempotent. No app-level auth: the public gateways\n(ingress-public/*.yaml) 404 the /api/internal/ prefix, so only\ncluster-internal callers reach it.","operationId":"reap_orphans_endpoint_api_internal_flows_reap_orphans_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/flows/recover-stuck-exports":{"post":{"tags":["Flows"],"summary":"Recover Stuck Exports Endpoint","description":"Cron-only: detect & recover stuck export flow_runs (ghost concurrency slot).\n\nInternal endpoint. Called by the `prefect-recover-stuck-exports` CronJob\nevery 5 minutes. Idempotent. No app-level auth: the public gateways\n(ingress-public/*.yaml) 404 the /api/internal/ prefix, so only\ncluster-internal callers reach it.","operationId":"recover_stuck_exports_endpoint_api_internal_flows_recover_stuck_exports_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/history":{"get":{"tags":["History"],"summary":"Get History","operationId":"get_history_api_history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["History"],"summary":"Create History Item","operationId":"create_history_item_api_history_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHistoryItemPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchHistoryItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/history/{id}":{"get":{"tags":["History"],"summary":"Get History By Id","operationId":"get_history_by_id_api_history__id__get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchHistoryItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["History"],"summary":"Delete History Item","operationId":"delete_history_item_api_history__id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["History"],"summary":"Update History Item","operationId":"update_history_item_api_history__id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","title":"Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateHistoryItemPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leads/import/suggestions":{"post":{"tags":["Deduplication"],"summary":"Leads Import Suggestions","operationId":"leads_import_suggestions_api_leads_import_suggestions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_leads_import_suggestions_api_leads_import_suggestions_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leads/import":{"post":{"tags":["Deduplication"],"summary":"Leads Import","operationId":"leads_import_api_leads_import_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_leads_import_api_leads_import_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/leads/imports":{"get":{"tags":["Deduplication"],"summary":"Get Leads Imports","operationId":"get_leads_imports_api_leads_imports_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/explorer/search":{"post":{"summary":"Search Proxy","description":"Search and cluster companies/employees using LAV (Large-scale Attribute Vector) search.\nReturns clusters and individual results with their embeddings and scores.","operationId":"search_proxy_api_explorer_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplorerSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lookalike/search":{"post":{"summary":"Lookalike Search","description":"Запуск поиска похожих компаний по домену.\nВозвращает task_id для последующего получения результатов.","operationId":"lookalike_search_api_lookalike_search_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookalikeSearchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookalikeTaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lookalike/search/{attempt_id}":{"get":{"summary":"Lookalike Search Results","description":"Получение результатов поиска похожих компаний по task_id.","operationId":"lookalike_search_results_api_lookalike_search__attempt_id__get","parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","title":"Attempt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lookalike/companies_autocomplete":{"get":{"summary":"Autocomplete Companies","description":"Autocomplete for companies by domain prefix OR name substring.\nReturns [{name, domain}] — used by AutoGTM /new page.","operationId":"autocomplete_companies_api_lookalike_companies_autocomplete_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":50,"title":"Q"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lookalike/autocomplete":{"get":{"summary":"Autocomplete Domain","operationId":"autocomplete_domain_api_lookalike_autocomplete_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":50,"title":"Q"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search/filters":{"get":{"tags":["Companies","People"],"summary":"Get Companies Filters","operationId":"get_companies_filters_api_search_filters_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","title":"Query"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search/countries":{"get":{"tags":["Companies","People"],"summary":"Get Countries","operationId":"get_countries_api_search_countries_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/search/companies/favicon/{encoded_domain}":{"get":{"tags":["Companies","People"],"summary":"Get Company Favicon","operationId":"get_company_favicon_api_search_companies_favicon__encoded_domain__get","parameters":[{"name":"encoded_domain","in":"path","required":true,"schema":{"type":"string","title":"Encoded Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search/subdivisions":{"get":{"tags":["Companies","People"],"summary":"Get Subdivisions","description":"Get all subdivisions/states/regions","operationId":"get_subdivisions_api_search_subdivisions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/search/geo-suggest":{"get":{"tags":["Companies","People"],"summary":"Get Geo Suggestions","description":"Search for cities and/or subdivisions matching the query.\n\nArgs:\n    q: Search query (minimum 2 characters)\n    type: Filter by location type - 'city', 'subdivision', or 'all' (default)\n    limit: Maximum number of results (default 30, max 100)\n\nReturns:\n    Combined results from ClickHouse (cities) and static subdivisions.","operationId":"get_geo_suggestions_api_search_geo_suggest_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"type","in":"query","required":false,"schema":{"enum":["city","subdivision","all"],"type":"string","default":"all","title":"Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search/technologies":{"get":{"tags":["Companies","People"],"summary":"Get Technologies","description":"Get all available technologies","operationId":"get_technologies_api_search_technologies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/search/nace":{"get":{"tags":["Companies","People"],"summary":"Get Nace","description":"Get NACE Rev. 2 industry classification — sections and 4-digit classes.","operationId":"get_nace_api_search_nace_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/search/companies":{"post":{"summary":"Search Companies","operationId":"search_companies_api_search_companies_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchCompaniesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search/companies/{attempt_id}":{"get":{"tags":["Companies","People"],"summary":"Companies Search Results","operationId":"companies_search_results_api_search_companies__attempt_id__get","parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","title":"Attempt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search/people":{"post":{"tags":["Companies","People"],"summary":"People Search","operationId":"people_search_api_search_people_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeopleSearchPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search/people/{attempt_id}":{"get":{"tags":["Companies","People"],"summary":"People Search Results","operationId":"people_search_results_api_search_people__attempt_id__get","parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","title":"Attempt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search/people/estimate":{"post":{"tags":["Companies","People"],"summary":"People Estimate Stats","description":"Get people estimate stats including total count and job titles frequency (lazy loaded).\n\nReturns:\n    total_estimate: Total count of matching people\n    job_titles_freq: List of (job_title_id, job_title, count, score) tuples","operationId":"people_estimate_stats_api_search_people_estimate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeopleEstimateStatsPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search/companies/estimate":{"post":{"tags":["Companies","People"],"summary":"Companies Estimate Stats","description":"Get companies estimate stats including total count and definitions statistics (lazy loaded).\n\nReturns:\n    total_estimate: Total count of matching companies\n    definitions_stats: List of definition statistics with id, name, count, and score","operationId":"companies_estimate_stats_api_search_companies_estimate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompaniesEstimateStatsPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user/profile":{"get":{"tags":["User"],"summary":"Profile","operationId":"profile_api_user_profile_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization/invites":{"get":{"tags":["User"],"summary":"Get Organization Invites","operationId":"get_organization_invites_api_organization_invites_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization/invites/bonus-progress":{"get":{"tags":["User"],"summary":"Get Invite Bonus Progress","operationId":"get_invite_bonus_progress_api_organization_invites_bonus_progress_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization/invites/{invite_id}":{"get":{"tags":["User"],"summary":"Get Invite","operationId":"get_invite_api_organization_invites__invite_id__get","parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","title":"Invite Id"}},{"name":"sig","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sig"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["User"],"summary":"Delete Invite","operationId":"delete_invite_api_organization_invites__invite_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","title":"Invite Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization/invites/send":{"post":{"tags":["User"],"summary":"Send Invite","operationId":"send_invite_api_organization_invites_send_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendInviteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization/invites/{invite_id}/accept":{"get":{"tags":["User"],"summary":"Accept Invite","operationId":"accept_invite_api_organization_invites__invite_id__accept_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","title":"Invite Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization/user/{user_id}":{"delete":{"tags":["User"],"summary":"Remove User From Organization","operationId":"remove_user_from_organization_api_organization_user__user_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization/update":{"post":{"tags":["User"],"summary":"Update Organization","operationId":"update_organization_api_organization_update_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrganizationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization/users":{"get":{"tags":["User"],"summary":"Get Organization Users","operationId":"get_organization_users_api_organization_users_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization/users/role":{"patch":{"tags":["User"],"summary":"Update User Role","operationId":"update_user_role_api_organization_users_role_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRoleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization/api-keys":{"get":{"tags":["User"],"summary":"Get Api Keys","operationId":"get_api_keys_api_organization_api_keys_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["User"],"summary":"Create Api Key","operationId":"create_api_key_api_organization_api_keys_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization/api-keys/{key_id}":{"delete":{"tags":["User"],"summary":"Revoke Api Key","operationId":"revoke_api_key_api_organization_api_keys__key_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization/deletion-eligibility":{"get":{"tags":["User"],"summary":"Get Organization Deletion Eligibility","operationId":"get_organization_deletion_eligibility_api_organization_deletion_eligibility_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization/stop-campaigns":{"post":{"tags":["User"],"summary":"Stop Organization Campaigns","operationId":"stop_organization_campaigns_api_organization_stop_campaigns_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/organization":{"delete":{"tags":["User"],"summary":"Delete Organization","operationId":"delete_organization_api_organization_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/web-search":{"post":{"summary":"Web Search Ui Endpoint","operationId":"web_search_ui_endpoint_api_web_search_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebSearchUIPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebSearchUIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/support/bot/webhook":{"post":{"tags":["support-bot"],"summary":"Crisp Webhook","description":"Crisp Website Hook target. Authenticated via ``?secret=``. Acks fast and\nruns the bot as a Starlette BackgroundTask so Crisp isn't kept waiting.\n\n(We use BackgroundTasks, not a bare ``asyncio.create_task``: Starlette keeps a\nstrong reference and runs it after the response, so it can't be garbage-\ncollected mid-flight — a bare create_task we don't hold a ref to gets GC'd and\ncancelled intermittently, silently dropping replies.)","operationId":"crisp_webhook_api_support_bot_webhook_post","parameters":[{"name":"secret","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Crisp Webhook Api Support Bot Webhook Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/support/bot/sweep":{"post":{"tags":["support-bot"],"summary":"Stale Sweep","description":"Run one stale-sweep pass: force-escalate bot-handled conversations that\nsat unresolved past ``max_age`` (ADR-0049). Called every 10 min by the\n``support-stale-sweep`` k8s CronJob — the safeguard's ONLY production\ntrigger since the webhook replaced the polling loop the sweep lived in.\nThe per-run escalation cap keeps the drain under the Yani watcher's\nstorm-breaker threshold.\n\nThe cron sends the secret as ``X-Webhook-Secret`` — a query secret lands in\nthe gunicorn access log on every run (144×/day). ``?secret=`` stays accepted\nonly because `_check_secret` is shared with the Crisp webhook, which can't\nset headers.\n\nThe response reports denominators (``pages``/``candidates``) on purpose:\n``escalated: 0`` alone can't distinguish \"all clear\" from \"discovery went\nblind\" (digest-style rule 9).","operationId":"stale_sweep_api_support_bot_sweep_post","parameters":[{"name":"secret","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"}},{"name":"max_age","in":"query","required":false,"schema":{"type":"number","minimum":60.0,"default":3600.0,"title":"Max Age"}},{"name":"cap","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":50,"minimum":1},{"type":"null"}],"title":"Cap"}},{"name":"X-Webhook-Secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Webhook-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Stale Sweep Api Support Bot Sweep Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/support/bot/incident/set":{"post":{"tags":["support-bot"],"summary":"Incident Set","description":"Raise the active-incident flag: the bot stops answering engage-path questions\nand escalates with this note until /incident/clear. Set it when an outage starts\n(manually or from the alerting pipeline).","operationId":"incident_set_api_support_bot_incident_set_post","parameters":[{"name":"secret","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"}},{"name":"note","in":"query","required":false,"schema":{"type":"string","default":"service incident in progress","title":"Note"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Incident Set Api Support Bot Incident Set Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/support/bot/incident/clear":{"post":{"tags":["support-bot"],"summary":"Incident Clear","operationId":"incident_clear_api_support_bot_incident_clear_post","parameters":[{"name":"secret","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Incident Clear Api Support Bot Incident Clear Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/support/bot/shipped-requests/processed":{"get":{"tags":["support-bot"],"summary":"Shipped Requests Processed","description":"Release ids the daily routine does not need to inspect again.","operationId":"shipped_requests_processed_api_support_bot_shipped_requests_processed_get","parameters":[{"name":"X-Support-Secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Support-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Shipped Requests Processed Api Support Bot Shipped Requests Processed Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/support/bot/shipped-requests/send":{"post":{"tags":["support-bot"],"summary":"Shipped Requests Send","description":"Send one agent-approved release batch and mark the release processed.","operationId":"shipped_requests_send_api_support_bot_shipped_requests_send_post","parameters":[{"name":"X-Support-Secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Support-Secret"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowupBatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Shipped Requests Send Api Support Bot Shipped Requests Send Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/dashboard/interested-leads":{"get":{"tags":["AppAutoGtm"],"summary":"Get Interested Leads","description":"T-2750 — the «Interested» facet of the dashboard leads feed (see\n`_fetch_interested_leads`). Scoped like the dashboard: whole project, or\none campaign when `campaign` is passed.","operationId":"get_interested_leads_api_app_auto_gtm_projects__project_id__dashboard_interested_leads_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"campaign","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Campaign"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InterestedLeadsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/dashboard":{"get":{"tags":["AppAutoGtm"],"summary":"Get Project Dashboard","description":"Return KPI aggregate for all campaigns in a project.\n\nQuery params:\n    period: 'today' | '7d' | '30d' | 'all' (default '7d')\n    campaign: optional segment_id to restrict to one campaign\n\nOwnership: project.org_id must match the caller's current org.\nDaily breakdown, last-replies and total_hot_leads_today are scoped to\nthe selected campaign when `campaign` is set, otherwise the whole\nproject. The campaign_rollup list is always empty for a single-campaign\nview (one row would be redundant).","operationId":"get_project_dashboard_api_app_auto_gtm_projects__project_id__dashboard_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"period","in":"query","required":false,"schema":{"enum":["today","7d","30d","all"],"type":"string","default":"7d","title":"Period"}},{"name":"campaign","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Campaign"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDashboardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/budget":{"get":{"tags":["AppAutoGtm"],"summary":"Get Project Budget","description":"Return the project's daily-budget anchor (one indexed read).","operationId":"get_project_budget_api_app_auto_gtm_projects__project_id__budget_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectBudgetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["AppAutoGtm"],"summary":"Set Project Budget","description":"Set the project budget cap and even-spread the change across campaigns.","operationId":"set_project_budget_api_app_auto_gtm_projects__project_id__budget_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetProjectBudgetRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectBudgetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/budget":{"patch":{"tags":["AppAutoGtm"],"summary":"Set Segment Budget","description":"The user edits one campaign's daily budget from the dashboard table.\n\nThin adapter over :func:`set_segment_budget_for_org` (the same org-scoped\nservice the public API calls). Reconcile semantic (Q3, confirmed): the edited\ncampaign's ``daily_limit_usd`` is set DIRECTLY and the project total becomes\nthe SUM of the outreach campaigns' budgets — the OTHER campaigns are NOT\ntouched. It preserves the ``sum(campaigns) == anchor`` invariant by\nconstruction, so the reconcile safety-net stays a no-op.\n\nGated on ``project.autopilot_enabled`` (agent-owned split → 409); budget\nbelongs to RUNNING campaigns only (paused/pre-launch → 409). Ownership: the\nsegment's project.org_id must match the caller's current org (miss → 404).","operationId":"set_segment_budget_api_app_auto_gtm_segments__segment_id__budget_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSegmentBudgetRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentBudgetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/inbox/contacts":{"get":{"tags":["AppAutoGtm"],"summary":"Get Project Inbox Contacts","description":"Paged contacts list across all campaigns (or a single one).\n\nWraps OutreachService.get_contacts with the project's segment set.\n`campaign=all` => no segment filter.\n`campaign={segmentId}` => scoped to that single segment.\n`tab=need_reply|replied|sent` => filter to the corresponding bucket.\n`manual_status={name}` => only leads with that manual status (T-444);\n`manual_status=__none__` => only leads with no manual status.\nOmitting `tab` returns the full visible universe (equivalent to\n`tab=sent`). Other params mirror GET /segments/{id}/outreach/contacts.","operationId":"get_project_inbox_contacts_api_app_auto_gtm_projects__project_id__inbox_contacts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","default":"all","title":"Campaign"}},{"name":"intent","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Intent"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Search"}},{"name":"tab","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tab"}},{"name":"manual_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Manual Status"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Project Inbox Contacts Api App Auto Gtm Projects  Project Id  Inbox Contacts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/inbox/contact":{"get":{"tags":["AppAutoGtm"],"summary":"Get Project Inbox Contact","description":"One fully-populated contact by ``person_id`` — tab-agnostic.\n\nPowers the inbox right pane's \"open by ``?person=``\" path. The pane\nmust render a conversation even when the contact isn't in the\ncurrently-loaded tab list — e.g. after a reply moves them out of\nNeed reply, or a deep-link / reload lands on a person who lives on\nanother tab. Returns the SAME row shape as\n``GET .../inbox/contacts`` so the frontend reuses one renderer and\nthe header never disagrees with the list. 404 when the person has no\nvisible outreach row in this project.","operationId":"get_project_inbox_contact_api_app_auto_gtm_projects__project_id__inbox_contact_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"person","in":"query","required":true,"schema":{"type":"string","description":"person_id from outreach_sent_emails","title":"Person"},"description":"person_id from outreach_sent_emails"},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Project Inbox Contact Api App Auto Gtm Projects  Project Id  Inbox Contact Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/inbox/counts":{"get":{"tags":["AppAutoGtm"],"summary":"Get Project Inbox Counts","description":"Tab + chip counters for the Project Inbox header.\n\nReturns the three tab counters (``need_reply`` / ``replied`` / ``sent``)\nplus ``available_filters`` — the dynamic chip list for All replies,\nwhere each entry has ``{key, label, icon, count}``. All numbers come\nfrom a single SQL helper (:func:`api.outreach.db.get_inbox_bucket_counts`)\nso the tab and chip displays never disagree.\n\nProject-wide when ``campaign=all``; scoped to one segment when\n``campaign={segmentId}``. Filters with zero leads under the current\ncampaign scope are omitted from ``available_filters`` so the chip\nrow stays clean.","operationId":"get_project_inbox_counts_api_app_auto_gtm_projects__project_id__inbox_counts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"campaign","in":"query","required":false,"schema":{"type":"string","default":"all","title":"Campaign"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxCountsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/inbox/lead/{person_id}":{"get":{"tags":["AppAutoGtm"],"summary":"Get Project Inbox Lead","description":"Lead dossier for the inbox right pane (T-446): the lead's person +\ncompany snapshot (from ``agent_lead.raw_person`` / ``raw_company``)\nplus a cached one-line \"why this lead fits\" verdict.\n\nResponse shape is a FROZEN contract the frontend codes against —\ncoordinate any change with it. 404 when the lead doesn't exist or\ndoesn't belong to one of this project's campaigns (segments).\n\n``why_fits`` is generated on first read (bounded LLM call; see\n``lead_dossier.ensure_why_fits``) and cached on the row — this endpoint\nnever 500s on an LLM failure, it just returns ``why_fits: null``.","operationId":"get_project_inbox_lead_api_app_auto_gtm_projects__project_id__inbox_lead__person_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"person_id","in":"path","required":true,"schema":{"type":"string","title":"Person Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Project Inbox Lead Api App Auto Gtm Projects  Project Id  Inbox Lead  Person Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/schedule-countries":{"get":{"tags":["AppAutoGtm"],"summary":"Get Schedule Countries","description":"Country rows for the Schedule tab's audience table.","operationId":"get_schedule_countries_api_app_auto_gtm_projects__project_id__schedule_countries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleCountriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/setup-steps/{step}/visit":{"post":{"tags":["AppAutoGtm"],"summary":"Visit Setup Step","description":"Record the visit that closes a view-only step.\n\nIdempotent — the target screen fires it on arrival, which happens again\nevery time the user comes back, and the row is keyed on (project, step).\nReturns a JSON body on purpose: a bare 204 makes the frontend's\n`apiClient` throw (`_dashboard/api.ts`).","operationId":"visit_setup_step_api_app_auto_gtm_projects__project_id__setup_steps__step__visit_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"step","in":"path","required":true,"schema":{"type":"string","title":"Step"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Visit Setup Step Api App Auto Gtm Projects  Project Id  Setup Steps  Step  Visit Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/stop-feedback":{"post":{"tags":["AppAutoGtm"],"summary":"Submit Stop Feedback","operationId":"submit_stop_feedback_api_app_auto_gtm_stop_feedback_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopFeedbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Submit Stop Feedback Api App Auto Gtm Stop Feedback Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/lead-status-vocab":{"get":{"tags":["AppAutoGtm"],"summary":"Get Lead Status Vocab","operationId":"get_lead_status_vocab_api_app_auto_gtm_projects__project_id__lead_status_vocab_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadStatusVocab"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["AppAutoGtm"],"summary":"Add Lead Status","description":"Append a custom status (name + colour) to the project vocabulary.\n\nPersists the full resolved list (presets + customs) the first time a\nproject is touched, so the NULL-means-presets fallback stays consistent.","operationId":"add_lead_status_api_app_auto_gtm_projects__project_id__lead_status_vocab_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddLeadStatusRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadStatusVocab"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/leads/{lead_id}/status":{"get":{"tags":["AppAutoGtm"],"summary":"Get Lead Status","description":"Return a single lead's manual funnel status ({status: str | null}).\n\nLightweight, isolated read for the inbox status picker so it never has to\npiggyback on the (heavier) thread / contacts payloads.","operationId":"get_lead_status_api_app_auto_gtm_segments__segment_id__leads__lead_id__status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Lead Status Api App Auto Gtm Segments  Segment Id  Leads  Lead Id  Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["AppAutoGtm"],"summary":"Set Lead Status","description":"Set (or clear, with ``status: null``) a lead's manual funnel status.\n\n``lead_id`` is the ``AgentLead.id`` UUID — the same identifier the inbox\nthread (``outreach_sent_emails.person_id``) and the leads-list row (``id``)\nboth carry, so one endpoint serves both surfaces.","operationId":"set_lead_status_api_app_auto_gtm_segments__segment_id__leads__lead_id__status_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetLeadStatusRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Lead Status Api App Auto Gtm Segments  Segment Id  Leads  Lead Id  Status Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/leads/{lead_id}/note":{"get":{"tags":["AppAutoGtm"],"summary":"Get Lead Note","description":"A single lead's note ({note, updated_at, updated_by}, all nullable).\n\nLightweight, isolated read for the Lead info panel — same shape of\nendpoint as ``get_lead_status`` so it never piggybacks on the heavier\nthread / dossier payloads.","operationId":"get_lead_note_api_app_auto_gtm_segments__segment_id__leads__lead_id__note_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Lead Note Api App Auto Gtm Segments  Segment Id  Leads  Lead Id  Note Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["AppAutoGtm"],"summary":"Set Lead Note","description":"Set (or clear, with ``note: null`` / empty) a lead's shared note.\n\n``lead_id`` is the ``AgentLead.id`` UUID — the same identifier the inbox\nthread carries as ``person_id``. Last-write-wins; the caller's email is\nstamped as ``updated_by`` for the attribution line.","operationId":"set_lead_note_api_app_auto_gtm_segments__segment_id__leads__lead_id__note_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetLeadNoteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Lead Note Api App Auto Gtm Segments  Segment Id  Leads  Lead Id  Note Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/integrations":{"get":{"tags":["AppAutoGtm"],"summary":"Get Integrations","operationId":"get_integrations_api_app_auto_gtm_projects__project_id__integrations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/integrations/hubspot/connect-url":{"post":{"tags":["AppAutoGtm"],"summary":"Hubspot Connect Url","description":"Signed authorize URL for the HubSpot consent screen (frontend redirects).","operationId":"hubspot_connect_url_api_app_auto_gtm_projects__project_id__integrations_hubspot_connect_url_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/integrations/hubspot/pipelines":{"get":{"tags":["AppAutoGtm"],"summary":"Hubspot Pipelines","description":"Live deal pipelines/stages from the connected portal (for the stage picker).","operationId":"hubspot_pipelines_api_app_auto_gtm_projects__project_id__integrations_hubspot_pipelines_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PipelinesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/integrations/hubspot":{"patch":{"tags":["AppAutoGtm"],"summary":"Patch Hubspot Integration","operationId":"patch_hubspot_integration_api_app_auto_gtm_projects__project_id__integrations_hubspot_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchHubspotRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["AppAutoGtm"],"summary":"Disconnect Hubspot","description":"Disconnect = revoke the grant on HubSpot's side (best-effort), then\nhard-delete the row (tokens gone, push ledger cascades).","operationId":"disconnect_hubspot_api_app_auto_gtm_projects__project_id__integrations_hubspot_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Disconnect Hubspot Api App Auto Gtm Projects  Project Id  Integrations Hubspot Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/integrations/hubspot/sync":{"post":{"tags":["AppAutoGtm"],"summary":"Sync Hubspot Hot Leads","description":"Backfill all EXISTING hot leads into the connected HubSpot (the live\nhook only covers hot leads that happen after connect). Idempotent per lead\nvia the push ledger — pressing Sync repeatedly never duplicates deals.\nRuns in the background; the page's pushed counter reflects progress.","operationId":"sync_hubspot_hot_leads_api_app_auto_gtm_projects__project_id__integrations_hubspot_sync_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/autopilot-activity":{"get":{"tags":["AppAutoGtm"],"summary":"Get Autopilot Activity","description":"Recent autopilot actions for a project, newest first.\n\nAvailable regardless of the current ``autopilot_enabled`` state — the\nhistory stays readable after the user turns the autopilot off.","operationId":"get_autopilot_activity_api_app_auto_gtm_projects__project_id__autopilot_activity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutopilotActivityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/pricing":{"get":{"tags":["AppAutoGtm"],"summary":"Get Pricing","description":"Global billing constants + offer config for the AutoGTM UI.\n\nStatic — no DB access. Returns the same shape as autogtm-back's\npublic /api/pricing-config so the dashboard slider and the paywall\ncalculator share one source of truth (api/app_auto_gtm/projections.py).\n\nCaller email is threaded through so per-account UI-floor overrides\n(`projections.SPECIAL_DAILY_MIN_USD`) can lower the slider min for\nspecific customers without touching the global anchor.","operationId":"get_pricing_api_app_auto_gtm_pricing_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/app-auto-gtm/billing/auto-topup/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Auto Topup Tick","description":"One pass over orgs that need topping up.\n\nSee ``api/app_auto_gtm/billing_cron.run_topup_tick`` for the full logic.","operationId":"auto_topup_tick_api_internal_app_auto_gtm_billing_auto_topup_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopupTickResponse"}}}}}}},"/api/internal/app-auto-gtm/billing/stuck-trial-users/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Stuck Trial Users Tick","operationId":"stuck_trial_users_tick_api_internal_app_auto_gtm_billing_stuck_trial_users_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Stuck Trial Users Tick Api Internal App Auto Gtm Billing Stuck Trial Users Tick Post"}}}}}}},"/api/internal/app-auto-gtm/funnel-latency/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Funnel Latency Tick","operationId":"funnel_latency_tick_api_internal_app_auto_gtm_funnel_latency_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Funnel Latency Tick Api Internal App Auto Gtm Funnel Latency Tick Post"}}}}}}},"/api/internal/app-auto-gtm/billing/expired-postpaid/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Expired Postpaid Tick","operationId":"expired_postpaid_tick_api_internal_app_auto_gtm_billing_expired_postpaid_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpiredPostpaidTickResponse"}}}}}}},"/api/internal/app-auto-gtm/billing/reconcile-budgets/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Reconcile Budgets Tick","operationId":"reconcile_budgets_tick_api_internal_app_auto_gtm_billing_reconcile_budgets_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconcileBudgetsTickResponse"}}}}}}},"/api/internal/app-auto-gtm/digest-daily/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Digest Daily Tick","description":"One pass over candidate users. See\n``api/app_auto_gtm/digest_daily.run_digest_tick`` for the full logic.","operationId":"digest_daily_tick_api_internal_app_auto_gtm_digest_daily_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigestDailyTickResponse"}}}}}}},"/api/internal/app-auto-gtm/launch-update/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Launch Update Tick","operationId":"launch_update_tick_api_internal_app_auto_gtm_launch_update_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LaunchUpdateTickResponse"}}}}}}},"/api/internal/app-auto-gtm/autopilot-recap/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Autopilot Recap Tick","description":"Daily cron: send one combined Autopilot recap per project that the\nautopilot acted on in the last window (accumulated, at most once/day). Hit by\na k8s CronJob like the digest / launch-update ticks. (T-205)","operationId":"autopilot_recap_tick_api_internal_app_auto_gtm_autopilot_recap_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Autopilot Recap Tick Api Internal App Auto Gtm Autopilot Recap Tick Post"}}}}}}},"/api/internal/app-auto-gtm/autopilot-slack-digest/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Autopilot Slack Digest Tick","description":"Daily cron: post ONE aggregate Autopilot summary to #autogtm-agent for the\njust-closed UTC day + a link to a detailed HTML artifact on p.explee.com.\nReplaces the per-retro real-time spam. Hit by a k8s CronJob hourly at\n00:05–06:05 UTC: the posted-day marker makes retries idempotent, so a tick\nkilled mid-run (deploy rollout, curl timeout) is retried on the next hour\ninstead of silently losing the day. (T-304)","operationId":"autopilot_slack_digest_tick_api_internal_app_auto_gtm_autopilot_slack_digest_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Autopilot Slack Digest Tick Api Internal App Auto Gtm Autopilot Slack Digest Tick Post"}}}}}}},"/api/app-auto-gtm/founder-nudges/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Founder Nudges Tick","operationId":"founder_nudges_tick_api_app_auto_gtm_founder_nudges_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FounderNudgesTickResponse"}}}}}}},"/api/internal/app-auto-gtm/founder-mail/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Founder Mail Tick","operationId":"founder_mail_tick_api_internal_app_auto_gtm_founder_mail_tick_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FounderMailFlowDispatchResponse"}}}}}}},"/api/internal/app-auto-gtm/founder-mail/pmf-blast/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Founder Mail Pmf Blast Tick","operationId":"founder_mail_pmf_blast_tick_api_internal_app_auto_gtm_founder_mail_pmf_blast_tick_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FounderMailFlowDispatchResponse"}}}}}}},"/api/internal/app-auto-gtm/founder-mail/talk-to-us/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Founder Mail Talk To Us Tick","operationId":"founder_mail_talk_to_us_tick_api_internal_app_auto_gtm_founder_mail_talk_to_us_tick_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FounderMailFlowDispatchResponse"}}}}}}},"/api/internal/app-auto-gtm/founder-mail/self-check/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Founder Mail Self Check Tick","operationId":"founder_mail_self_check_tick_api_internal_app_auto_gtm_founder_mail_self_check_tick_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FounderMailFlowDispatchResponse"}}}}}}},"/api/internal/app-auto-gtm/founder-mail/interview-reminder/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Founder Mail Interview Reminder Tick","operationId":"founder_mail_interview_reminder_tick_api_internal_app_auto_gtm_founder_mail_interview_reminder_tick_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FounderMailFlowDispatchResponse"}}}}}}},"/api/internal/app-auto-gtm/founder-mail/sunday-review/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Founder Mail Sunday Review Tick","operationId":"founder_mail_sunday_review_tick_api_internal_app_auto_gtm_founder_mail_sunday_review_tick_post","parameters":[{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FounderMailFlowDispatchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/app-auto-gtm/reactivation/draft":{"post":{"tags":["AppAutoGtm"],"summary":"Reactivation Draft","operationId":"reactivation_draft_api_internal_app_auto_gtm_reactivation_draft_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReactivationDraftRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReactivationDraftResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/app-auto-gtm/reactivation/classify":{"post":{"tags":["AppAutoGtm"],"summary":"Reactivation Classify","operationId":"reactivation_classify_api_internal_app_auto_gtm_reactivation_classify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReactivationClassifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReactivationClassifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/app-auto-gtm/reactivation/send-test":{"post":{"tags":["AppAutoGtm"],"summary":"Reactivation Send Test","operationId":"reactivation_send_test_api_internal_app_auto_gtm_reactivation_send_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReactivationSendTestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReactivationSendTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/app-auto-gtm/disable-test-users/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Disable Test Users Tick","description":"One pass over the disposable test accounts. Mirrors the tick endpoints\nabove (Redis NX self-lock, try/finally cleanup).","operationId":"disable_test_users_tick_api_internal_app_auto_gtm_disable_test_users_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisableTestUsersTickResponse"}}}}}}},"/api/internal/app-auto-gtm/project-docs/backfill-tick":{"post":{"tags":["AppAutoGtm"],"summary":"Project Docs Backfill Tick","description":"One bounded pass of the фактура extraction backfill. See\n``api/app_auto_gtm/project_docs_extract.run_backfill_tick``.","operationId":"project_docs_backfill_tick_api_internal_app_auto_gtm_project_docs_backfill_tick_post","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Project Docs Backfill Tick Api Internal App Auto Gtm Project Docs Backfill Tick Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/app-auto-gtm/retrospectives/dispatch/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Retro Dispatch Tick","description":"One pass over pending retrospectives. See\n``api/flows/agent_chat_retro_actor.dispatch_pending_retrospectives``.","operationId":"retro_dispatch_tick_api_internal_app_auto_gtm_retrospectives_dispatch_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetroDispatchTickResponse"}}}}}}},"/api/internal/app-auto-gtm/retrospectives/starvation-batch":{"post":{"tags":["AppAutoGtm"],"summary":"Retro Starvation Batch","operationId":"retro_starvation_batch_api_internal_app_auto_gtm_retrospectives_starvation_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StarvationBatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Retro Starvation Batch Api Internal App Auto Gtm Retrospectives Starvation Batch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/app-auto-gtm/weekly-trial-digest/tick":{"post":{"tags":["AppAutoGtm"],"summary":"Weekly Trial Digest Tick","description":"One pass over last week's trial cohort. See\n``api/app_auto_gtm/weekly_trial_digest.run_weekly_trial_digest``.","operationId":"weekly_trial_digest_tick_api_internal_app_auto_gtm_weekly_trial_digest_tick_post","parameters":[{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WeeklyTrialDigestTickResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/digest-daily/unsubscribe":{"get":{"tags":["AppAutoGtm"],"summary":"Digest Daily Unsubscribe Page","description":"Render the confirmation form. Token is looked up against\n``autogtm_digest_unsubscribe_tokens``; missing/unknown tokens return 404.","operationId":"digest_daily_unsubscribe_page_api_app_auto_gtm_digest_daily_unsubscribe_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"type":"string","default":"","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["AppAutoGtm"],"summary":"Digest Daily Unsubscribe Confirm","description":"Process the form POST. Idempotent — repeated unsubscribes flip a\nboolean that's already False.","operationId":"digest_daily_unsubscribe_confirm_api_app_auto_gtm_digest_daily_unsubscribe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/app-auto-gtm/autopilot-recap/unsubscribe":{"get":{"tags":["AppAutoGtm"],"summary":"Autopilot Recap Unsubscribe Page","description":"One-click opt-out form for the «Автопилот» recap. Sets only the recap\ncadence to 'off' — the daily digest is a separate setting and is untouched.","operationId":"autopilot_recap_unsubscribe_page_api_app_auto_gtm_autopilot_recap_unsubscribe_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"type":"string","default":"","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["AppAutoGtm"],"summary":"Autopilot Recap Unsubscribe Confirm","description":"Process the recap opt-out form. Idempotent (sets cadence to 'off').","operationId":"autopilot_recap_unsubscribe_confirm_api_app_auto_gtm_autopilot_recap_unsubscribe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/app-auto-gtm/notification-preferences":{"get":{"tags":["AppAutoGtm"],"summary":"Get Notification Preferences","description":"Per-type email opt-outs for the signed-in user (daily digest + autopilot\nrecap) — read by the Notifications settings UI. Absent = ON.","operationId":"get_notification_preferences_api_app_auto_gtm_notification_preferences_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferences"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["AppAutoGtm"],"summary":"Update Notification Preferences","description":"Partial update of the signed-in user's per-type email opt-outs. Only the\nprovided types are written; the rest of the JSONB is preserved via an atomic\n``|| jsonb`` merge (so a concurrent one-click unsubscribe can't be clobbered\nby a read-modify-write).","operationId":"update_notification_preferences_api_app_auto_gtm_notification_preferences_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferencesUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferences"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/user":{"get":{"tags":["AppAutoGtm"],"summary":"Get User Context","operationId":"get_user_context_api_app_auto_gtm_user_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserContextResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/orgs-with-projects":{"get":{"tags":["AppAutoGtm"],"summary":"Get Orgs With Projects","description":"List this user's *other* orgs (not the active one) that hold a real\nAutoGTM project — the app shell offers a multi-org user a one-click switch\nout of an empty org into one with their work (T-341). \"Real project\"\nmirrors the ``/user`` definition: an active project with at least one\nsegment, archived included (segmentless shells don't count; a project\nwhose campaigns are all archived is still the user's work — T-1708). Ordered\nnewest-project first so the most recent workspace is at the top. Empty list\nwhen no other org qualifies (the current org's empty-state then stands).","operationId":"get_orgs_with_projects_api_app_auto_gtm_orgs_with_projects_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgsWithProjectsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/unread-counts":{"get":{"tags":["AppAutoGtm"],"summary":"Get Unread Counts","description":"Unreplied-hot-lead counts for the sidebar badges, split out of ``/user``.\n\nThe ``unreplied_hot`` CTE is the heaviest part of the old app-shell query;\nserving it here lets the sidebar render instantly and hydrate the badges\nfrom a separate, non-blocking poll. Redis-cached per org (short TTL) so the\npoll — and concurrent org members / tabs — stay cheap.\n\nOrg-scoped by the org's segment ids and deliberately NOT filtered by the\nviewer's ``user_email``, so every member sees the org's real hot-lead\ncounts (matches the old ``/user`` behaviour and the dashboard CTA).","operationId":"get_unread_counts_api_app_auto_gtm_unread_counts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnreadCountsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/referral":{"get":{"tags":["AppAutoGtm"],"summary":"Get Referral Info","description":"The referral page payload (T-17): the org's share link (code minted\nlazily on first visit) + the \"who I invited\" ledger from ``guest_referral``.\n\n``started`` rows (link visited, no card yet) surface as ``pending`` with a\nNULL email — the visitor is anonymous until they pay.","operationId":"get_referral_info_api_app_auto_gtm_referral_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralInfoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}":{"get":{"tags":["AppAutoGtm"],"summary":"Get Project Context","description":"Project + its segments for the workspace shell.\n\nArchived campaigns are excluded by default (T-1619): they are visible only\non the Dashboard (its own endpoint) and in the archived campaign's own\nworkspace — that page opts in with ``?include_archived=1``. Every other\nconsumer gets live campaigns without having to remember to filter.\n\n``people_count`` is left at 0 here and NOT computed: this endpoint is HOT\n(SSR-prefetched on every project open + re-fetched on every SSE lifecycle\nevent), nothing in the workspace renders the per-segment lead count, and the\nCOUNT over the 200+GB ``agent_lead`` table was the dominant cost of this\nendpoint's p95 (~18s, 2026-06-30). The onboarding wizard's default-segment\npick degrades gracefully — its real driver is the cheap funnel-side count\n(``/domain-preview``); this field was only a last-resort tiebreaker before\n\"pick the first segment\", and is 0 at onboarding time anyway (a just-created\nproject has no enriched leads yet). The real per-segment count still lives on\n``/segments/{id}`` (``SegmentBrief``), which the lead/template views use.","operationId":"get_project_context_api_app_auto_gtm_projects__project_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectContextResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["AppAutoGtm"],"summary":"Update Project","description":"Patch editable project-level fields surfaced in the Docs form.\n\nAccepts `description`, `competitors`, and `company_name` (stored in\n`Project.info['company_name']`). The remainder of `Project.info` (industry,\nteam_size, founded, location, …) is funnel-sourced and returned as-is for\nrendering. Per-segment targeting hints live on the Segment — see\nPATCH /segments/{id}.\n\ncompany_name changes additionally bump `email_templates_version` on every\nsegment in the project: the email-generation LLM prompt reads\n`info.company_name` (api/app_auto_gtm/email_rag._profile_offer_block) and\nits output is cached in `generated_email` keyed by version, so without the\nbump previews + future enqueues would keep the old name.","operationId":"update_project_api_app_auto_gtm_projects__project_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDetails"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/retrospectives":{"post":{"tags":["AppAutoGtm"],"summary":"Trigger Retrospective","description":"Manually enqueue a project orchestrator retrospective.\n\nCreates a `new` project_retrospective and fires the worker. Returns\nscheduled=False (retrospective_id=None) when an active run already covers\nthe project — the partial-unique gate dedupes concurrent triggers.\n\nAn explicit manual trigger passes ``force=True`` to bypass the deploy-dark\ngate (``retro_agent_enabled``) — that gate only suppresses the AUTO triggers.\nTools still honour dry-run mode, so a manual run stays non-mutating while\n``retro_agent_dry_run`` is on.","operationId":"trigger_retrospective_api_app_auto_gtm_projects__project_id__retrospectives_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerRetrospectiveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/domain-preview":{"get":{"tags":["AppAutoGtm"],"summary":"Get Domain Preview","description":"Read-only preview for a domain before we create the project in our DB.\n\nBacked by GtmProject + GtmSegment (the marketing funnel side). Lets the\nonboarding wizard show \"here's what we know about your company\" before\nthe user commits.\n\n404 with `{code: \"gtm_project_not_found\"}` when the funnel hasn't\ngenerated anything for this domain — the client redirects to the funnel\nitself (explee.com/auto-gtm/company/{domain}/explore) so the user\ngenerates segments and comes back.","operationId":"get_domain_preview_api_app_auto_gtm_domain_preview_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","title":"Domain"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects":{"post":{"tags":["AppAutoGtm"],"summary":"Create Project","operationId":"create_project_api_app_auto_gtm_projects_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/domain-availability":{"get":{"tags":["AppAutoGtm"],"summary":"Get Domain Availability","description":"T-710: the single \"can I create a project on this domain?\" flag for the\nonboarding.\n\n``available`` is False when the domain is blacklisted (example / freemail /\npublic company) OR already taken by 2+ other orgs — the same rule\n``create_project`` enforces (``409 domain_unavailable``). The onboarding uses\nthis read-only twin to render the \"can't be used → contact support\" screen up\nfront instead of running the whole pipeline first.\n\nT-973: an org that already holds an ACTIVE project on the domain always\npasses — ``create_project`` checks its own-project branch BEFORE the gate\n(``project_exists`` 409 / enrich the stale-empty shell in place), so the\nprobe must too, or the two disagree and the project's owner lands on the\n\"contact support\" dead-end (the onboarding can't shield this case itself:\n``/user`` hides segmentless shells, so its ``existingProject`` guard misses\nexactly the stale-empty project).","operationId":"get_domain_availability_api_app_auto_gtm_domain_availability_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","title":"Domain"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Domain Availability Api App Auto Gtm Domain Availability Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/_ops/domain-taken-override/{org_id}":{"post":{"tags":["AppAutoGtm"],"summary":"Override Domain Taken","description":"Explee-staff: create the project for a support-verified org on a TAKEN domain.\n\nThe support lever behind the T-710 \"domain already taken → contact support\"\ndead-end: once a human verifies the user really owns the domain (a third\ncoworker, a rebrand, …), this bridges their funnel demo into a real project\nexactly like ``create_project`` would, bypassing only the taken-domain gate.\nNo ``debug_admin_enabled`` env-gate on purpose — releasing an honest user\nmust work in production. Idempotent: an existing active project for\n(org, domain) is returned as-is.","operationId":"override_domain_taken_api_app_auto_gtm__ops_domain_taken_override__org_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Override Domain Taken Api App Auto Gtm  Ops Domain Taken Override  Org Id  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/launch":{"post":{"tags":["AppAutoGtm"],"summary":"Launch Segment","description":"Prepare a segment for launch: apply budget (+ optional target_url).\n\nThe agent session itself is still created by the client via\n`POST /api/agent-chat/sessions` — we don't want to spawn a Claude CLI\nsubprocess from this request. Keeping the split lets the client flow\nstay unchanged while this endpoint takes care of the one-shot writes\n(budget + target_url) that used to leak across the 2-3 calls\nof onboarding/MiniOnboarding.\n\n`target_url` is not required here — discovery/research runs fine without\nit. Outreach workers must gate on a non-empty value separately; the UI\ngates the Launch button so most callers will supply it.","operationId":"launch_segment_api_app_auto_gtm_segments__segment_id__launch_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LaunchSegmentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LaunchSegmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/batch-launch":{"post":{"tags":["AppAutoGtm"],"summary":"Batch Launch Segments","description":"Launch multiple segments in one request.\n\nSingle affordability check; budget + optional target_url applied to every\nsegment. Each segment must belong to an active project owned by the caller's\norg. Returns the IDs that were successfully updated.","operationId":"batch_launch_segments_api_app_auto_gtm_segments_batch_launch_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchLaunchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchLaunchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}":{"get":{"tags":["AppAutoGtm"],"summary":"Get Segment","operationId":"get_segment_api_app_auto_gtm_segments__segment_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["AppAutoGtm"],"summary":"Update Segment","operationId":"update_segment_api_app_auto_gtm_segments__segment_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentBrief"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/spent-today":{"get":{"tags":["AppAutoGtm"],"summary":"Get Segment Spent Today","description":"Cheap snapshot for the Budget tab \"today's spend\" progress bar.\n\nDB-only — never touches Stripe/Redis. Safe to refetch every ~30s from\nthe UI without inflating the bigger SegmentBrief request.","operationId":"get_segment_spent_today_api_app_auto_gtm_segments__segment_id__spent_today_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentSpentTodayResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/billing/credits-activity":{"get":{"tags":["AppAutoGtm"],"summary":"Get Credits Activity","description":"Where the balance came from — every credit deposit as a human-readable\nline (Gleb, T-17 thread: \"юзер совсем не понимает, откуда у него на\nбалансе бабки\").\n\nReads the wallet ledger's ``add`` rows (``bil_wallet_slot_log``): trials,\nreferral bonuses, coupons, and real-money top-ups (``price_per_unit > 0``\non the slot). $0 marker rows (deferred/explore trials) and internal hold\nreleases are noise, not deposits — excluded.","operationId":"get_credits_activity_api_app_auto_gtm_billing_credits_activity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsActivityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/billing/balance":{"get":{"tags":["AppAutoGtm"],"summary":"Get Billing Balance","description":"Org wallet balance + warning thresholds for the inbox banner.\n\nSums credits across all the org's active (non-deleted, non-expired)\nwallet slots — the same set ``billing.precheck_sync`` consults\nwhen gating sends. Threshold semantics live here so the UI doesn't\nhave to encode them: ``is_empty`` mirrors the precheck ``no_funds``\nrejection (balance < 1 email's cost), ``is_low`` is a soft warning.","operationId":"get_billing_balance_api_app_auto_gtm_billing_balance_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingBalanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/billing/postpaid":{"get":{"tags":["AppAutoGtm"],"summary":"Get Billing Postpaid","description":"AutoGTM postpaid (overdraft) tier state for the Billing UI.\n\nReturns the active slot's headroom + settled count + the org's\ncurrent tier rung. The tier_number / tier_cap_credits fields are\npopulated even when no active slot exists so prepaid users\n(no card / no overdraft history) still see a meaningful \"Tier 1\nup to $5\" subtitle on the unified balance card (issue #801).","operationId":"get_billing_postpaid_api_app_auto_gtm_billing_postpaid_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/spent-today":{"get":{"tags":["AppAutoGtm"],"summary":"Get Org Spent Today","description":"Org-wide \"spent today\" snapshot for the global Billing tab.\n\nAggregates autogtm sends across all the org's segments and sums the\nper-segment caps over segments currently in the `outreach` phase.","operationId":"get_org_spent_today_api_app_auto_gtm_spent_today_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSpentTodayResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/sending-identity":{"get":{"tags":["AppAutoGtm"],"summary":"Get Sending Identity","description":"T-41 PR-4 — read-only sender visibility for the \"Sending from\" UI.\n\nWhich identity this org's campaigns send from: its own sending domains\n(with warming/active status) once it owns any, and the sender names on\nits active dedicated mailboxes. ``pool='dedicated'`` uses the same\npredicate as the send-side picker gate\n(``api.outreach.db.org_has_active_dedicated_mailboxes``) so the badge\ncan never claim an identity the picker wouldn't use; an org whose\ndomains are still warming stays ``pool='shared'``.\n\nA shared-pool org (every org until the T-41 BYO onboarding ships) gets\nthe empty shell — the operator fleet's domains/mailboxes must never\nleak through this endpoint.\n\nT-41 rollout switch: while BYO rolls out, orgs not listed in\n``OUTREACH_BYO_ENABLED_ORGS`` (``outreach_db.byo_org_enabled`` — the same\nswitch that short-circuits the picker gate) get the empty shell no matter\nwhat rows exist, so the UI stays exactly current-prod for every real user.","operationId":"get_sending_identity_api_app_auto_gtm_sending_identity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingIdentityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/billing/usage-daily":{"get":{"tags":["AppAutoGtm"],"summary":"Get Billing Usage Daily","description":"Per-UTC-day cold-send usage for the Billing \"Usage\" panel (T-638).\n\nCounted from sent emails × price (the project-dashboard spend\nconvention) — one Index Only Scan, so the page opens instantly for\nany org size. Replies (free) are excluded; a bounced-after-send email\nstays counted (its charge is never refunded).","operationId":"get_billing_usage_daily_api_app_auto_gtm_billing_usage_daily_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageDailyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/retarget":{"post":{"tags":["AppAutoGtm"],"summary":"Retarget Segment","description":"Global Targeting screen \"Save & re-search\" (T-286).\n\nPersist the free-text geo / company-size targeting prompts onto the segment,\nthen — if the segment is actively working — nudge its agent to re-search with\nthe new targeting (the agent re-reads both fields live from\nbuild_segment_context). A paused campaign (user-paused / $0-budget / no-card)\nor a not-yet-launched one just stores the values; they apply on resume/launch.","operationId":"retarget_segment_api_app_auto_gtm_segments__segment_id__retarget_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetargetRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetargetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/retarget":{"post":{"tags":["AppAutoGtm"],"summary":"Retarget Segments","description":"Apply one targeting to a set of campaigns in a single request (T-286).\n\nThe \"use the same targeting for every campaign\" action: instead of the\nbrowser firing one POST /segments/{id}/retarget per campaign, this writes the\nsame geo / company-size prompts to every selected campaign in ONE transaction,\nthen nudges each live campaign to re-search. Mirrors the project-scoped\nsave-templates / save-links \"apply to all\" pattern. Returns the per-campaign\naction so the client can show the same breakdown the N-call path showed.","operationId":"retarget_segments_api_app_auto_gtm_projects__project_id__retarget_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRetargetRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRetargetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments":{"post":{"tags":["AppAutoGtm"],"summary":"Create Segment","description":"Create a segment under the user's project, prefilled by the same LLM\npass the funnel uses for its n=6 explore generation.\n\nThe user supplies only the segment name; the LLM produces pain /\nuse_case / criteria / example_clients tailored to that label using the\nproject's domain, description and competitors. On any LLM failure\n(timeout, parse error, empty response) we surface a 500 — better that\nthe user retries than ends up with an unusable empty segment that\nblocks the sender downstream.","operationId":"create_segment_api_app_auto_gtm_segments_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSegmentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentBrief"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/generate-email-templates":{"post":{"tags":["AppAutoGtm"],"summary":"Generate Email Templates","description":"LLM-build the outreach brief for `segment` and persist it.\n\nLifted out of `bridge.run_bridge` so `POST /projects` returns in <1s\ninstead of waiting on the 15-30s LLM round-trip. The frontend fires\nthis endpoint as soon as the user picks a campaign in the onboarding\nwizard, so by the time they reach the template-editor sub-step the\nbrief is already populated and `email_templates_version > 0`.\n\nIdempotent: if the segment already carries non-empty instructions, the\nLLM call is skipped and the existing brief is returned. Failures\n(timeout, parse error) leave the row untouched (DEFAULT_TEMPLATES are\nNOT written — empty instructions would block the sender, same policy\nas the old bridge code).","operationId":"generate_email_templates_api_app_auto_gtm_segments__segment_id__generate_email_templates_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentBrief"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/archive":{"post":{"tags":["AppAutoGtm"],"summary":"Archive Project Endpoint","description":"Archive a whole project: cancel its queued cold emails, stop live\ncampaigns to Paused, zero all budgets, autopilot off, hide it everywhere\n(`is_active=false`). The project-level analog of campaign archive —\nsee api/app_auto_gtm/project_archive.py. Reversible via /unarchive\n(campaigns stay Paused and budgets stay $0 after restore). Idempotent:\narchiving an already-archived project is a no-op 200.","operationId":"archive_project_endpoint_api_app_auto_gtm_projects__project_id__archive_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Archive Project Endpoint Api App Auto Gtm Projects  Project Id  Archive Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/unarchive":{"post":{"tags":["AppAutoGtm"],"summary":"Unarchive Project Endpoint","description":"Restore an archived project into every list/dashboard. Campaigns stay\nPaused and budgets stay $0 — restore never silently resumes spend (the\ncampaign-archive invariant). 409 `domain_conflict` when the org created a\nnew active project on the same domain while this one was archived\n(partial unique index uq_project_org_domain_active).","operationId":"unarchive_project_endpoint_api_app_auto_gtm_projects__project_id__unarchive_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Unarchive Project Endpoint Api App Auto Gtm Projects  Project Id  Unarchive Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/reply-preview":{"post":{"tags":["AppAutoGtm"],"summary":"Reply Preview","description":"Throwaway auto-reply draft on a real case from this project, generated\nwith the caller's DRAFT instructions (the composer text, not a saved\nfield). Picks the most recent inbound reply (hot_lead preferred); a\nproject without replies falls back to a real lead + synthetic inbound\n(``sample=true``). Deliberately uncached — see api/app_auto_gtm/reply_preview.py.","operationId":"reply_preview_api_app_auto_gtm_projects__project_id__reply_preview_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplyPreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplyPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/reply-preview-leads":{"get":{"tags":["AppAutoGtm"],"summary":"Reply Preview Leads","description":"Lead options for the reply-composer's preview picker: leads with a\nreal inbound reply first; fallback real leads (synthetic inbound); the\nexample persona when the project has no leads at all.","operationId":"reply_preview_leads_api_app_auto_gtm_projects__project_id__reply_preview_leads_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplyPreviewLeadsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/reply-preview-case":{"get":{"tags":["AppAutoGtm"],"summary":"Reply Preview Case","description":"The conversation the reply preview answers — the same case resolution\nas POST /reply-preview minus the LLM, so the Replies tab shows the thread\nthe moment it opens while the draft generates (T-1906, step 2a of the\nT-1289 rollout). Real replies only: a project (or pinned ``person_id``)\nwithout a real inbound reply gets ``case: null`` — never a synthetic\ninbound (the tab renders its own empty state). Deliberately uncached,\nlike /reply-preview.","operationId":"reply_preview_case_api_app_auto_gtm_projects__project_id__reply_preview_case_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"person_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplyPreviewCaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/project-docs":{"get":{"tags":["AppAutoGtm"],"summary":"List Project Docs","description":"Live docs for a project, user-first then newest-first, + the type vocab.","operationId":"list_project_docs_api_app_auto_gtm_projects__project_id__project_docs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["AppAutoGtm"],"summary":"Create Project Doc","description":"Create a user doc (``source='user'``).","operationId":"create_project_doc_api_app_auto_gtm_projects__project_id__project_docs_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/project-docs/{doc_id}":{"patch":{"tags":["AppAutoGtm"],"summary":"Update Project Doc","description":"Edit a doc's type/title/content.\n\nEditing an AI-added doc flips ``source`` to ``'user'`` permanently — the\nhuman has curated it, so the future extraction cron (T-1120) never\noverwrites it.","operationId":"update_project_doc_api_app_auto_gtm_projects__project_id__project_docs__doc_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDocItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["AppAutoGtm"],"summary":"Delete Project Doc","description":"Soft-delete a doc.\n\nReturns 200 + a JSON body (not 204): the web ApiClient always parses the\nresponse as JSON, so an empty 204 body throws in the browser.","operationId":"delete_project_doc_api_app_auto_gtm_projects__project_id__project_docs__doc_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveOkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/save-links":{"post":{"tags":["AppAutoGtm"],"summary":"Save Project Links","description":"Save booking links for a project.\n\nAccepts EITHER a shared_url (applied to every segment) OR a per_segment\nmapping (segment_id → url). Validates each non-empty url with\n_gate_target_url (format + LLM scam gate) and 422s on the first invalid\nvalue (input order).\n\nThree phases, in a fixed order (T-1526):\n1. authz reads in a short session — ownership 404s BEFORE any external\n   call, so a stranger can't burn Scrapfly/LLM against a project they\n   don't own;\n2. the gates, OUTSIDE any transaction — the fetch+LLM gate runs up to\n   ~45s per URL (GATE_DEADLINE_SECONDS), and the old single-transaction shape held segment row\n   locks and an idle-in-transaction connection across that I/O;\n3. a write-only transaction with the UPDATEs (re-checks the project so a\n   concurrently-deleted one isn't resurrected by a blind write).","operationId":"save_project_links_api_app_auto_gtm_projects__project_id__save_links_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveLinksRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveOkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/save-templates":{"post":{"tags":["AppAutoGtm"],"summary":"Save Project Templates","description":"Apply one email template to every campaign in the project, transactionally.\n\nThis is the \"apply to all\" action — per-campaign edits go through\nPATCH /segments/{id} (one at a time, from the template editor). Builds the\nJSONB email_templates shape via _build_email_templates and bumps\nemail_templates_version only for segments whose templates actually changed.","operationId":"save_project_templates_api_app_auto_gtm_projects__project_id__save_templates_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveTemplatesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveOkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/save-followup-rules":{"post":{"tags":["AppAutoGtm"],"summary":"Save Project Followup Rules","description":"Apply one follow-up sequence to every campaign in the project, transactionally.\n\nThe \"apply to all\" action for follow-ups (T-372) — per-campaign edits go\nthrough PATCH /segments/{id}. One transaction instead of N concurrent client\nPATCHes (which could partially fail and leave campaigns inconsistent). rules\nis already clamped by SegmentFollowupRules (max_touches <= 6, delay_days in\n[1,30]).","operationId":"save_project_followup_rules_api_app_auto_gtm_projects__project_id__save_followup_rules_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveFollowupRulesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveOkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/projects/{project_id}/save-schedule":{"post":{"tags":["AppAutoGtm"],"summary":"Save Project Schedule","description":"Apply the same send schedule to every campaign in one transaction.","operationId":"save_project_schedule_api_app_auto_gtm_projects__project_id__save_schedule_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveProjectScheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveOkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/self-reported-source":{"patch":{"tags":["AppAutoGtm"],"summary":"Set Self Reported Source","description":"Post-purchase \"How did you hear about us?\" — stores the self-reported\nacquisition channel on the USER row. Best-effort from the onboarding step.","operationId":"set_self_reported_source_api_app_auto_gtm_self_reported_source_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelfReportedSourceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveOkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/companies/search":{"get":{"tags":["AppAutoGtm"],"summary":"Companies Search","description":"Autocomplete for the Competitors chip-input. Mirrors the funnel's\n`GET /companies/search` (autogtm/back/explore/__init__.py:315) but lives\non the authenticated app-auto-gtm router so the frontend can call it\nsame-origin without CORS.","operationId":"companies_search_api_app_auto_gtm_companies_search_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Companies Search Api App Auto Gtm Companies Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/leads":{"get":{"tags":["AppAutoGtm"],"summary":"Get Segment Leads","operationId":"get_segment_leads_api_app_auto_gtm_segments__segment_id__leads_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"people_offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"People Offset"}},{"name":"people_limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"People Limit"}},{"name":"companies_offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Companies Offset"}},{"name":"companies_limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Companies Limit"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentLeadsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/leads/breakdown":{"get":{"tags":["AppAutoGtm"],"summary":"Get Segment Leads Breakdown","description":"Stat breakdown (geo / job titles / company sizes) for a segment's leads.\n\nSplit out of `get_segment_leads` so these full-segment aggregates NEVER\nblock the page's first paint: the leads list SSR-renders from `/leads`,\nwhile these stats load client-side via a separate non-blocking query.\nPagination doesn't re-compute them either — they don't change per page.","operationId":"get_segment_leads_breakdown_api_app_auto_gtm_segments__segment_id__leads_breakdown_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadsBreakdown"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/leads/byol-import":{"post":{"tags":["AppAutoGtm"],"summary":"Byol Import Leads","description":"Bring-your-own-leads (T-44): import a self-contained CSV into a new\n``created_by='import'`` campaign — leads inserted directly from the provided\nfields (never gated on our CH base), enriched from our base where possible,\nemails verified (free), deduped, then AUTO-APPROVED into ``outreach``.\n\nStreams NDJSON progress events so the import screen shows live progress\ninstead of a frozen spinner (verification is the slow step):\n  ``{\"type\":\"progress\",\"stage\":\"verifying\",\"done\":42,\"total\":100}``\nthen a terminal ``{\"type\":\"result\", ...}`` or ``{\"type\":\"error\",\"detail\":...}``.\n\n**Feature flag:** the UI entry is gated by ``byol_import`` (default off,\ntoggled on /feature-flags). The flag is the rollout control; this endpoint\njust requires an authenticated org member.","operationId":"byol_import_leads_api_app_auto_gtm_leads_byol_import_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_byol_import_leads_api_app_auto_gtm_leads_byol_import_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/preview-emails":{"get":{"tags":["AppAutoGtm"],"summary":"Preview Emails","description":"Return (or generate+cache) preview emails for ONE lead.\n\nSingle-lead flow: the UI asks for a specific `lead_id` (typically whichever\nlead is currently selected in the \"Preview as\" dropdown). Backend generates\nonly for that lead — avoids spending tokens on leads the user never opens\nand keeps `GenerationThinking` overlay short.\n\n``touch`` scopes the request to ONE touch so a cache-miss request is a\nsingle generation that fits the worker budget (issue #1338: both touches\nin one request blew past the gunicorn timeout and surfaced as connection\nresets). The client requests touch-1, then touch-2 as a dependent query —\neach touch commits its cache row immediately, so a retry never re-pays\nfor an already-generated touch. An unconfigured ``touch`` returns ``[]``\n(200): \"no follow-up set up\" is a normal state, not an error. Without\n``touch`` the legacy walk over all configured touches is kept for\nold clients during the rolling deploy.\n\nIdempotent: `generated_email` is the cache keyed by\n(lead_id, touch_number, email_templates_version). Switching leads in the\nUI is a fresh queryKey on the client; revisiting a previously-selected\nlead within the same session is a cache hit (react-query), and even\nacross sessions the backend returns the cached DB rows without another\nLLM call. Touch-2 self-heals a missing touch-1 row via\n``get_or_generate_email``'s internal recursion.\n\nGeneration failures return structured details the client can render:\n400 ``{code: 'no_template'|'leak_detected', touch, message}`` for user-\nfixable states, 502 ``{code: 'generation_failed', touch, message}`` for\nupstream LLM failures (kept distinct from our own 500s in monitoring).\n\n`language_used` and `highlights` come out of the JSONB `snapshot` on\neach row — no new DB column, old rows default to empty values.","operationId":"preview_emails_api_app_auto_gtm_segments__segment_id__preview_emails_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"lead_id","in":"query","required":true,"schema":{"type":"string","title":"Lead Id"}},{"name":"touch","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3,"minimum":1},{"type":"null"}],"title":"Touch"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GeneratedEmailPayload"},"title":"Response Preview Emails Api App Auto Gtm Segments  Segment Id  Preview Emails Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/preview-emails/draft":{"post":{"tags":["AppAutoGtm"],"summary":"Preview Emails Draft","description":"Render a preview against UNSAVED template instructions.\n\nCompanion to GET /preview-emails. The GET reads from\n``segment.email_templates`` (saved state). This POST takes the\ninstructions inline so the editor can validate (preview + moderate)\nBEFORE persisting — template only lands in the DB after the user\nconfirms a clean preview, then PATCH /segments fires Save.\n\nNo cache writes. Each call regenerates against the supplied\ninstructions; the saved-state cache (``generated_email``) is keyed\nby ``email_templates_version`` and updates only via the GET path\nafter Save commits the new version.\n\nTouches generate sequentially so each follow-up receives the prior\ntouch's body as ``prev_email`` (mirrors the production sender exactly).\n``touches`` scopes the render to one editor's touches; a follow-up-only\nrequest anchors on the cached saved-state touch 1.","operationId":"preview_emails_draft_api_app_auto_gtm_segments__segment_id__preview_emails_draft_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftPreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GeneratedEmailPayload"},"title":"Response Preview Emails Draft Api App Auto Gtm Segments  Segment Id  Preview Emails Draft Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/moderate-preview":{"post":{"tags":["AppAutoGtm"],"summary":"Moderate Preview Endpoint","description":"Moderate a rendered preview's subject + body separately from\ngeneration.\n\nSplits moderation off the /preview-emails response so the email body\nrenders fast and the moderation indicator runs on its own request —\nthe frontend can show a delayed \"Checking content…\" indicator and the\nuser sees the email immediately instead of waiting for moderation\nafter generation. The verdict surfaces in a banner on the preview\ncard (and a top-level alert near the Save button) when blocked.\n\nAuth: org-scoped via the segment so a malicious caller can't moderate\narbitrary text against another tenant's quota.","operationId":"moderate_preview_endpoint_api_app_auto_gtm_segments__segment_id__moderate_preview_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModeratePreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModeratePreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/dedup/import":{"post":{"tags":["AppAutoGtm"],"summary":"Dedup Import","operationId":"dedup_import_api_app_auto_gtm_dedup_import_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_dedup_import_api_app_auto_gtm_dedup_import_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DedupImportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/dedup/lists":{"get":{"tags":["AppAutoGtm"],"summary":"Dedup Lists","operationId":"dedup_lists_api_app_auto_gtm_dedup_lists_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DedupListsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/dedup/lists/{source_name}":{"get":{"tags":["AppAutoGtm"],"summary":"Dedup List Entries","operationId":"dedup_list_entries_api_app_auto_gtm_dedup_lists__source_name__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source_name","in":"path","required":true,"schema":{"type":"string","title":"Source Name"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DedupSourceEntries"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["AppAutoGtm"],"summary":"Dedup Delete","operationId":"dedup_delete_api_app_auto_gtm_dedup_lists__source_name__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source_name","in":"path","required":true,"schema":{"type":"string","title":"Source Name"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DedupDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/dedup/domains/import":{"post":{"tags":["AppAutoGtm"],"summary":"Dedup Domains Import","operationId":"dedup_domains_import_api_app_auto_gtm_dedup_domains_import_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_dedup_domains_import_api_app_auto_gtm_dedup_domains_import_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockedDomainsImportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/dedup/domains/add":{"post":{"tags":["AppAutoGtm"],"summary":"Dedup Domains Add","description":"Type-it-in sibling of the CSV import: appends to the persistent\n\"Added manually\" list instead of creating a new one per call.","operationId":"dedup_domains_add_api_app_auto_gtm_dedup_domains_add_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockedDomainsAddRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockedDomainsImportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/dedup/domains/entry":{"delete":{"tags":["AppAutoGtm"],"summary":"Dedup Domains Delete Entry","operationId":"dedup_domains_delete_entry_api_app_auto_gtm_dedup_domains_entry_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source_name","in":"query","required":true,"schema":{"type":"string","maxLength":255,"title":"Source Name"}},{"name":"domain","in":"query","required":true,"schema":{"type":"string","maxLength":255,"title":"Domain"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DedupDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/dedup/domains/lists":{"get":{"tags":["AppAutoGtm"],"summary":"Dedup Domains Lists","operationId":"dedup_domains_lists_api_app_auto_gtm_dedup_domains_lists_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DedupListsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/dedup/domains/lists/{source_name}":{"get":{"tags":["AppAutoGtm"],"summary":"Dedup Domains List Entries","operationId":"dedup_domains_list_entries_api_app_auto_gtm_dedup_domains_lists__source_name__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source_name","in":"path","required":true,"schema":{"type":"string","title":"Source Name"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockedDomainSourceEntries"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["AppAutoGtm"],"summary":"Dedup Domains Delete","operationId":"dedup_domains_delete_api_app_auto_gtm_dedup_domains_lists__source_name__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"source_name","in":"path","required":true,"schema":{"type":"string","title":"Source Name"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DedupDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent/ensure/{segment_id}":{"post":{"summary":"Agent Ensure","operationId":"agent_ensure_api_agent_ensure__segment_id__post","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent/{run_id}/stream":{"get":{"summary":"Agent Stream","description":"SSE stream — polls run_events table (cursor-based). Shared with /run/{id}/stream.","operationId":"agent_stream_api_agent__run_id__stream_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent/{run_id}/reset_enrichment":{"post":{"summary":"Reset Enrichment","description":"Delete enrichment cache so it can be re-run (e.g. after payment).\n\nAnonymous, like the rest of the demo — but a run enriched by a KNOWN device\nmay only be reset by that device (T-2296): re-running is what buys a fresh\nround of real lookups, so a stranger holding the run_id could otherwise\nreplay that cost at will and wipe the payer's result. A run enriched\nanonymously has no owner to protect and stays open — that is the\nfree-visitor-pays-then-re-runs path the frontend uses.","operationId":"reset_enrichment_api_agent__run_id__reset_enrichment_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent/{run_id}/draft_shown":{"post":{"summary":"Notify Draft Shown","description":"Frontend callback: first email draft has been shown to the user.","operationId":"notify_draft_shown_api_agent__run_id__draft_shown_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent/{run_id}/enrich_emails/stream":{"get":{"summary":"Enrich Emails Stream","operationId":"enrich_emails_stream_api_agent__run_id__enrich_emails_stream_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"device_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent/{run_id}/pipeline":{"get":{"summary":"Agent Pipeline","operationId":"agent_pipeline_api_agent__run_id__pipeline_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent/{run_id}/files":{"get":{"summary":"Agent Files","description":"Return file-like info from DB tables.","operationId":"agent_files_api_agent__run_id__files_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent/{run_id}/merged":{"get":{"summary":"Agent Merged","description":"Return companies with matched people inline.","operationId":"agent_merged_api_agent__run_id__merged_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent/{run_id}/file/{filename}":{"get":{"summary":"Agent File","description":"Return data from DB tables in file-like format.","operationId":"agent_file_api_agent__run_id__file__filename__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/draft/generate":{"post":{"summary":"Generate Draft","operationId":"generate_draft_api_draft_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftGenerateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/project/{identifier}/snapshot":{"get":{"summary":"Get Project Snapshot","description":"Return project data up to a given pipeline stage for static rendering.","operationId":"get_project_snapshot_api_project__identifier__snapshot_get","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string","title":"Identifier"}},{"name":"stage","in":"query","required":false,"schema":{"type":"string","default":"segments","title":"Stage"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/project/{identifier}":{"get":{"summary":"Get Project","operationId":"get_project_api_project__identifier__get","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string","title":"Identifier"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/email-capture":{"post":{"summary":"Email Capture","operationId":"email_capture_api_email_capture_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailCaptureRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/email-capture/send-csv":{"post":{"summary":"Email Capture Send Csv","description":"Trigger CSV send for a pending email capture (called after pipeline completes).","operationId":"email_capture_send_csv_api_email_capture_send_csv_post","parameters":[{"name":"project","in":"query","required":false,"schema":{"type":"string","default":"","title":"Project"}},{"name":"device_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/email-capture/check":{"get":{"summary":"Email Capture Check","operationId":"email_capture_check_api_email_capture_check_get","parameters":[{"name":"project","in":"query","required":false,"schema":{"type":"string","default":"","title":"Project"}},{"name":"device_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/calendar/availability":{"post":{"summary":"Save Calendar","operationId":"save_calendar_api_calendar_availability_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarAvailabilityRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Calendar","operationId":"get_calendar_api_calendar_availability_get","parameters":[{"name":"project","in":"query","required":false,"schema":{"type":"string","default":"","title":"Project"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/search":{"get":{"summary":"Companies Search","description":"Autocomplete company search — queries ClickHouse search tables.","operationId":"companies_search_api_companies_search_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/company":{"get":{"summary":"Company By Query","operationId":"company_by_query_api_company_get","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Id"}},{"name":"domain","in":"query","required":false,"schema":{"type":"string","default":"","title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/company/{identifier}":{"get":{"summary":"Company By Path","operationId":"company_by_path_api_company__identifier__get","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string","title":"Identifier"}},{"name":"explee_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Explee Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/run":{"post":{"summary":"Run","description":"Start unified pipeline. Returns run_id immediately, work happens in background thread.","operationId":"run_api_run_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/run/{run_id}/stream":{"get":{"summary":"Run Stream","description":"SSE stream that polls run_events table for new entries (cursor-based).","operationId":"run_stream_api_run__run_id__stream_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/payment/create-checkout":{"post":{"summary":"Create Checkout","description":"Hosted setup-mode Checkout Session — adblock fallback.\n\nUsed when ``js.stripe.com`` is blocked and the inline Payment Element\ncan't load. Collects Card on File ONLY: ``mode='setup'``, no line\nitems, no Subscription. Completion fires ``setup_intent.succeeded``,\nwhich runs the same Layer 2 / Layer 3 / grant flow as the inline\npath — single source of truth lives in the webhook.\n\n``setup_intent_data.metadata.device_id`` carries the device into the\nwebhook so the safety-net grant can route without a customer→device\nDB lookup, matching the inline flow's ``SetupIntent.create`` metadata.","operationId":"create_checkout_api_payment_create_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedCheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/payment/create-elements-checkout":{"post":{"summary":"Create Elements Checkout","description":"Create a SetupIntent for Payment Element flow.","operationId":"create_elements_checkout_api_payment_create_elements_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElementsCheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/payment/vault-card":{"post":{"summary":"Vault Card","description":"Capture a card through the Basis Theory vault, Stripe stays the processor.\n\nThe funnel form (behind ``NEXT_PUBLIC_BT_CHECKOUT``) tokenizes the PAN\ninto a BT token intent; this endpoint turns it into a regular Stripe\nPaymentMethod (BT Ephemeral Proxy — the PAN flows vault→Stripe directly),\nconfirms a SetupIntent with it, and converts the intent into a permanent\nvault token recorded in ``bil_vault_card``. Everything downstream\n(Layer 2/3 verify, card-on-file, trial grant, invoicing) is the unchanged\n``setup_intent.succeeded`` / ``activate-subscription`` machinery.\n\nOrder is load-bearing: the PM create runs BEFORE the intent→token\nconversion, because conversion drops the CVC (BT token-intents contract)\nand Stripe wants it on initial tokenization.","operationId":"vault_card_api_payment_vault_card_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultCardRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/payment/activate-subscription":{"post":{"summary":"Activate Subscription Endpoint","description":"Confirm card attached via SetupIntent — set default PM on Customer.\n\nNo Stripe Subscription is created. The card-trial bonus (5000 credits)\nis granted asynchronously by the ``setup_intent.succeeded`` webhook\nvia ``api.app_auto_gtm.card_trial.ensure_user_and_grant``.\n\nEndpoint name kept for frontend backwards-compat — historically this\nDID create a Subscription before postpaid-v2 (see git history of this\nfile for context).","operationId":"activate_subscription_endpoint_api_payment_activate_subscription_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateSubscriptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/payment/referral-check":{"get":{"summary":"Referral Check","description":"Is this ref code a T-17 referral code (→ show the \"+$25\" checkout badge)?\n\nExact match against ``organization.referral_code`` — blogger / paid-campaign\ncodes ride the same ``explee_ref`` cookie but must NOT show the badge (they\nonly carry the regular trial). Public and unauthenticated by design: it\nleaks only \"this code is somebody's referral code\", which the invite link\nitself already says.","operationId":"referral_check_api_payment_referral_check_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/payment/status":{"get":{"summary":"Payment Status","operationId":"payment_status_api_payment_status_get","parameters":[{"name":"device_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/payment/trial-starts-today":{"get":{"summary":"Trial Starts Today","description":"Public counter for the paywall social-proof strip (A/B paywall_buyers_v1).\n\nLeaks only the aggregate \"N trials started today\" — a number we display to\nevery funnel visitor anyway. Display floor/animation live client-side; on\na refresh failure the stale value is served and the strip degrades to its\nfloor on the client.","operationId":"trial_starts_today_api_payment_trial_starts_today_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/payment/webhook":{"post":{"summary":"Stripe Webhook","operationId":"stripe_webhook_api_payment_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/attribution/backfill":{"post":{"summary":"Attribution Backfill","description":"Recover attribution for users without ref_code by matching IP to Referral Clicks.\n\nCalled by cron every 5 minutes.","operationId":"attribution_backfill_api_internal_attribution_backfill_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/pricing-config":{"get":{"tags":["ExplorePricing"],"summary":"Pricing Config","description":"Public PayG pricing + offer constants for the landing/payment UI.\n\nSource of truth: api/app_auto_gtm/billing.py + card_trial.py + projections.py.\nRe-exported here so the Next.js Server Component can fetch the full\noffer config (price per email, trial credit, daily-budget bounds,\nforecast rates, \"what's included\" copy) at SSR time without\nround-tripping back to the main explee API.","operationId":"pricing_config_api_pricing_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/quote-prediction":{"get":{"tags":["ExplorePricing"],"summary":"Quote Prediction","description":"Predicted cost-per-lead band for an arbitrary company domain (T-952).\n\nSame anonymous trust tier as /api/pricing-config and /api/company: the\nquote funnel calls this for the visitor-entered domain. The prediction\ncomes from the realized outcomes of our most similar real customers\n(see api/app_auto_gtm/quote_prediction/) with a global-band fallback,\nnever from per-domain randomness.","operationId":"quote_prediction_api_quote_prediction_get","parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","minLength":3,"maxLength":253,"title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/img":{"get":{"tags":["ExploreImg"],"summary":"Img Proxy","description":"Favicon image proxy with host whitelist — applied to every redirect hop.","operationId":"img_proxy_api_img_get","parameters":[{"name":"url","in":"query","required":false,"schema":{"type":"string","default":"","title":"Url"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/bootstrap":{"post":{"tags":["Experiments"],"summary":"Bootstrap","description":"Materialise visitor ``ab_arms`` and mirror them into cookies.\n\nBody:\n  - ``device_id`` (optional; falls back to the ``explee_device_id``\n    cookie). Empty/missing → 400 — nothing to bucket. Capped at\n    64 chars (see :class:`BootstrapRequest`).\n  - ``missing`` (optional list of exp ids to enrol into; defaults\n    to all active visitor experiments).\n  - ``overrides`` (optional ``{exp_id: arm}``; honoured only when\n    ``_is_override_allowed`` returns True).\n\nSide effects:\n  - ``find_or_create_guest_user(device_id)`` — race-safe insert.\n  - Override pass (if allowed): JSONB-merge over existing keys\n    (REWRITE semantics).\n  - Enrol pass: JSONB-merge skipping any key already present\n    (snapshot lock).\n  - Set-Cookie ``ab_<exp_id>=<arm>`` for every key in the response\n    on the host's cookie-domain (``.explee.com`` /\n    ``.explee.local`` / host-only on localhost or sandbox env).\n\nReturns the post-write ``{exp_id: arm}`` snapshot. Idempotent —\ncalling twice yields the same result (and emits the same\nSet-Cookies).","operationId":"bootstrap_api_experiments_bootstrap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BootstrapRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__experiments__router__BootstrapResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/registry":{"post":{"tags":["Experiments"],"summary":"Create Experiment","operationId":"create_experiment_api_experiments_registry_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Experiments"],"summary":"List Experiments","operationId":"list_experiments_api_experiments_registry_get","parameters":[{"name":"funnel_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Funnel Id"}},{"name":"funnel_stage","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Funnel Stage"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/track":{"post":{"tags":["Experiments"],"summary":"Track Event","operationId":"track_event_api_experiments_track_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/migrate-running":{"post":{"tags":["Experiments"],"summary":"Migrate Running Experiments","description":"Register the currently-running legacy experiments as ``running`` rows\n(synchronous, commits immediately) and kick off the historical\n``ab_assignment`` backfill from ``ab_arms`` in the BACKGROUND — the backfill\nis a heavy bulk INSERT that would blow the HTTP timeout, so it runs unbound\nby the request. Both halves are idempotent; poll ``GET /sync-check`` for\nbackfill progress (``checked`` grows as it lands).","operationId":"migrate_running_experiments_api_experiments_migrate_running_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/sync-check":{"get":{"tags":["Experiments"],"summary":"Sync Check","description":"Observe old↔new synchronisation: per running experiment, how many enrolled\nsubjects' platform arm matches the live legacy ``ab_arms`` arm. ``mismatches``\nshould stay 0 the whole time both stores run in parallel.","operationId":"sync_check_api_experiments_sync_check_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/sync-events":{"post":{"tags":["Experiments"],"summary":"Sync Events","description":"Mirror real conversion events (anl_event + outreach replies) into\n``ab_event`` for enrolled subjects. The mirror runs in the BACKGROUND (the\nprod anl_event scan is heavy and would blow the HTTP timeout); it's\nidempotent, so a re-trigger resumes. Poll experiment results for progress.","operationId":"sync_events_api_experiments_sync_events_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/{key}/assign":{"post":{"tags":["Experiments"],"summary":"Assign","operationId":"assign_api_experiments__key__assign_post","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/{key}/cohort":{"get":{"tags":["Experiments"],"summary":"Cohort","operationId":"cohort_api_experiments__key__cohort_get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"subject_type","in":"query","required":true,"schema":{"type":"string","title":"Subject Type"}},{"name":"subject_id","in":"query","required":true,"schema":{"type":"string","title":"Subject Id"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/{key}/results":{"get":{"tags":["Experiments"],"summary":"Get Results","description":"Pure read: serves the cached payload, recomputing only on a miss.\nRefreshing is a different route because it writes — see below.","operationId":"get_results_api_experiments__key__results_get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"device","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device"}},{"name":"geo","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geo"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/{key}/results/refresh":{"post":{"tags":["Experiments"],"summary":"Refresh Results","description":"Recompute past the cache — the ab.d board's 🎰 button.\n\nIts own POST route, and write-scoped, because it is not a read: it runs an\ninline event-mirror pass that INSERTs into ``ab_event``, on top of a heavy\nprod scan. (Only that — the pass is ``light=True``, which skips the\n``attrs_*`` backfills that UPDATE ``ab_assignment``; those stay the cron's\njob.) This used to be ``GET ...?refresh=1`` guarded by an extra token check\ninside the handler (T-2303) — the method now says what the call does, and\nthe gate is the route's own dependency like everywhere else.","operationId":"refresh_results_api_experiments__key__results_refresh_post","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"device","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device"}},{"name":"geo","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geo"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/{key}/status":{"patch":{"tags":["Experiments"],"summary":"Patch Status","operationId":"patch_status_api_experiments__key__status_patch","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/{key}":{"patch":{"tags":["Experiments"],"summary":"Patch Experiment","operationId":"patch_experiment_api_experiments__key__patch","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Experiments"],"summary":"Get Experiment","operationId":"get_experiment_api_experiments__key__get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/{key}/lead-finder/enrol":{"post":{"tags":["Experiments"],"summary":"Enrol Lead Finder","description":"Enrol segments' EXISTING leads into one arm of a lead-finder experiment.\n\nDeliberately not ``agent inject``: this writes ``ab_assignment`` and\nnothing else — no search, no new leads, no re-rank, nothing that changes\nwhich email goes out or when. It is how the instrument gets pointed at\nlive data before an experiment depends on the readout, and how an agent\ndrives an experiment without a button.\n\nWrite-scoped, and restricted to ``lead_finder`` experiments: the same\nstatement aimed at a visitor test would quietly rewrite a cohort somebody\nis reading.","operationId":"enrol_lead_finder_api_experiments__key__lead_finder_enrol_post","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadFinderEnrolBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Experiments"],"summary":"Unenrol Lead Finder","description":"Close a lead-finder run: drop its assignment rows and its label from\n``agent_lead.ab_arms``.\n\nThe inverse of the enrol route, and the reason a probe run is safe to make\nat all — bookkeeping for one key, meaningless once the run is over, and\nactively misleading if left behind (a cohort that looks real). Restricted\nto ``lead_finder`` and to a card that is NOT running: closing a live\nexperiment's cohort out from under its readout is never what anyone meant.","operationId":"unenrol_lead_finder_api_experiments__key__lead_finder_enrol_delete","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/{key}/lead-finder/exclude":{"post":{"tags":["Experiments"],"summary":"Exclude Lead Finder Segments","description":"Take segments out of a RUNNING lead-finder experiment's answer.\n\nTwo modes, and the difference is whether the data survives:\n\n* default — the segments stay on the page with their own numbers and leave\n  the totals (the same treatment a frozen segment gets). Reversible: post\n  an empty list to put them back.\n* ``drop: true`` — their enrolment and lead assignments are deleted, and\n  they disappear from the page entirely. Not reversible.\n\nWhy this is not ``DELETE …/enrol``: that one wipes the whole experiment and\nrefuses to run on a live card. Taking a few segments out of a live one is a\ndifferent operation with a real use — a test account whose budget got\nzeroed leaves a cohort that can never send, and its zeros should not be\naveraged into the answer while its ``found`` numbers stay worth reading.","operationId":"exclude_lead_finder_segments_api_experiments__key__lead_finder_exclude_post","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadFinderExcludeBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/{key}/lead-finder/refresh":{"post":{"tags":["Experiments"],"summary":"Refresh Lead Finder","description":"Recompute the lead-finder read model now, instead of waiting for the tick.\n\nAccepted, then done in the background — the work is cohort-sized and an\nHTTP request is the wrong place for it. Measured 27.08: a full pass over\nthe 197k-lead probe outlived the gunicorn worker's max-requests recycle\nand came back as a 500 after 83 seconds, having done the work and thrown\nit away. The cron pass has no such ceiling; only this escape hatch did.\n\nPoll ``GET …/lead-finder`` for the result: ``computed_at`` is the oldest\nstamp among the segments, so it moves when the pass has actually landed.","operationId":"refresh_lead_finder_api_experiments__key__lead_finder_refresh_post","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/{key}/lead-finder/candidates":{"get":{"tags":["Experiments"],"summary":"Get Lead Finder Candidates","description":"Segments that COULD join this experiment.\n\nWrite-scoped although it only reads, and deliberately so: the answer is\nnot about this experiment at all — it ranks every outreach segment in the\ncompany by how much cold mail it has already sent, naming the client's\nproject domain next to each. That is a cross-client commercial readout,\nand the read token is handed to every A/B researcher precisely as a token\nthat cannot do anything but read their own experiment's numbers\n(``.agents/commands/hats/ab-researcher.md``). It is also an operator's\ntool — the input to choosing segments — not part of the readout.","operationId":"get_lead_finder_candidates_api_experiments__key__lead_finder_candidates_get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/experiments/{key}/lead-finder":{"get":{"tags":["Experiments"],"summary":"Get Lead Finder","description":"Per-segment, per-arm funnel for a lead-SOURCING experiment.\n\nIts own route rather than more fields on ``/results`` because it answers a\ndifferent shape of question — the card compares two arms on ONE event pair,\nthis lays the whole funnel out per segment and shows how much of each\nsegment had already been sent before the experiment landed. Not cached: a\npage view over an experiment-sized cohort, not the per-arm Bayesian\nrecompute that makes ``/results`` expensive.","operationId":"get_lead_finder_api_experiments__key__lead_finder_get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"hide_test","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Hide Test"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/scheduler/provision":{"post":{"tags":["CalBridgeExperiment"],"summary":"Scheduler Provision","description":"Mint a single-use magic-link the frontend can ``window.open()``.\n\nReturns 503 ``scheduler_unavailable`` in dev (settings empty) so the\nclient falls back to the bare cal.com login page without waiting on\na DB timeout. See EXPERIMENT.md §3.","operationId":"scheduler_provision_api_app_auto_gtm_scheduler_provision_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchedulerProvisionRequest","default":{"destination":"default"}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchedulerProvisionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/scheduler/calendar-status":{"get":{"tags":["CalBridgeExperiment"],"summary":"Scheduler Calendar Status","description":"Report whether the user's Cal.com account has a Google Calendar\ncredential — used by the frontend to swap between \"Connect\" and\n\"Connected ✓ + Manage calendars\".\n\nMirrors the dev-fallback 503 behaviour of ``/provision`` so the\nclient doesn't have to special-case this endpoint.","operationId":"scheduler_calendar_status_api_app_auto_gtm_scheduler_calendar_status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchedulerCalendarStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/outreach/cc/validate":{"post":{"tags":["outreach"],"summary":"Validate Outreach Cc","description":"Validate composer/default CC addresses before the UI creates chips.","operationId":"validate_outreach_cc_api_app_auto_gtm_outreach_cc_validate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CcValidationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CcValidationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/outreach/contacts":{"get":{"tags":["outreach"],"summary":"Get Outreach Contacts","description":"List contacts (people emailed in this segment) with send + reply status.\n\nPaged: returns ``{contacts, has_more, next_offset, total_count}``.\nOptional filters:\n- ``search``: receiver or sender email (case-insensitive substring).\n- ``intent``: comma-separated intent names (e.g.\n  ``\"hot_lead,not_interested\"``) — drives the inbox filter\n  pills and dashboard deep-links. Unknown values silently degrade\n  to no-filter.\n- ``ab``: repeatable A/B cohort filter ``\"<exp_id>:<arm>\"``. When\n  present, only contacts whose ``agent_lead.ab_arms`` row carries\n  every requested ``(exp, arm)`` pair are returned. Validated\n  against the lead-level REGISTRY in\n  ``api/outreach/experiments.py``; unknown ids / invalid arms\n  degrade to no-filter. Used by team/QA to slice the inbox by\n  experiment cohort via the API — no UI surface. Examples:\n  ``?ab=followup_v1:fresh_subject``,\n  ``?ab=followup_v1:control&ab=email_model_v1:mini``.","operationId":"get_outreach_contacts_api_app_auto_gtm_segments__segment_id__outreach_contacts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Search"}},{"name":"intent","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Intent"}},{"name":"ab","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"maxItems":10,"title":"Ab"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/outreach/thread/{person_id}":{"get":{"tags":["outreach"],"summary":"Get Outreach Thread","description":"Full conversation thread with a person (sent emails + replies).","operationId":"get_outreach_thread_api_app_auto_gtm_segments__segment_id__outreach_thread__person_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"person_id","in":"path","required":true,"schema":{"type":"string","title":"Person Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/outreach/thread/{person_id}/intent-feedback":{"post":{"tags":["outreach"],"summary":"Submit Intent Feedback","description":"Record the user's verification of the hot_lead classification.\n\nStamps ``user_intent`` on the latest reply (the inbox labeling gate).\nA ``not_relevant`` label additionally cancels any pending autopilot\nreply on the thread — a false positive shouldn't auto-send.","operationId":"submit_intent_feedback_api_app_auto_gtm_segments__segment_id__outreach_thread__person_id__intent_feedback_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"person_id","in":"path","required":true,"schema":{"type":"string","title":"Person Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntentFeedbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/outreach/notifications":{"get":{"tags":["outreach"],"summary":"Get Outreach Notifications","description":"Unseen reply count + unreplied hot count for the segment Inbox badge.\n\nScoped to the segment in the URL — the badge sits on a single segment's\nworkspace, so counting hot leads from sibling segments under the same\nproject (the previous project-wide scope) made the badge a non-zero\nnumber that didn't match the empty contact list.","operationId":"get_outreach_notifications_api_app_auto_gtm_segments__segment_id__outreach_notifications_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/outreach/replies/{reply_id}/attachments/{attachment_id}/download":{"get":{"tags":["outreach"],"summary":"Download Reply Attachment","description":"Resolve a v4 signed GCS URL for a single attachment and 302 to it.\n\nAuthz: the attachment must belong to a reply whose matched sent\nemail lives in this segment AND was sent by the calling user.\nUnmatched replies (no sent_email_id) are intentionally not\ndownloadable — they don't surface in any inbox thread either.","operationId":"download_reply_attachment_api_app_auto_gtm_segments__segment_id__outreach_replies__reply_id__attachments__attachment_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"reply_id","in":"path","required":true,"schema":{"type":"string","title":"Reply Id"}},{"name":"attachment_id","in":"path","required":true,"schema":{"type":"string","title":"Attachment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/outreach/replies/{reply_id}/original.eml":{"get":{"tags":["outreach"],"summary":"Download Reply Signed Original","description":"The DKIM-verifiable original of an inbound reply (Genuine email badge).\n\nServes the ingest-time stored ``signed_eml`` — DKIM-Signature + signed\nheaders + untouched body, transport headers stripped. Only exists for\nreplies with ``dkim_result='pass'``. Authz mirrors the reply-attachment\ndownload: reply must be matched into a sent email of this org-validated\nsegment.","operationId":"download_reply_signed_original_api_app_auto_gtm_segments__segment_id__outreach_replies__reply_id__original_eml_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"reply_id","in":"path","required":true,"schema":{"type":"string","title":"Reply Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/outreach/sent/{sent_email_id}/attachments/{attachment_id}/download":{"get":{"tags":["outreach"],"summary":"Download Sent Attachment","description":"Resolve a v4 signed GCS URL for an attachment WE sent and 302 to it.\n\nAuthz mirrors the reply-attachment download: the attachment must belong\nto a sent email in this segment, and the segment is org-validated for the\ncaller. Lets any org member re-download what was sent on the thread.","operationId":"download_sent_attachment_api_app_auto_gtm_segments__segment_id__outreach_sent__sent_email_id__attachments__attachment_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"sent_email_id","in":"path","required":true,"schema":{"type":"string","title":"Sent Email Id"}},{"name":"attachment_id","in":"path","required":true,"schema":{"type":"string","title":"Attachment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/outreach/send":{"post":{"tags":["outreach"],"summary":"Send Outreach Email","description":"Enqueue an outgoing email (typically a reply-to-thread).\n\nDefense-in-depth: the frontend already hides the composer for threads\nthat aren't reply-eligible (no prospect reply, or terminal intent). This\ngate makes the rule authoritative on the server so a stale client can't\nslip one through.","operationId":"send_outreach_email_api_app_auto_gtm_segments__segment_id__outreach_send_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachSendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/outreach/sent/{sent_email_id}/retry":{"post":{"tags":["outreach"],"summary":"Retry Outreach Reply","description":"Re-queue an undelivered user reply — the \"Send again\" action on the\nthread's \"Not delivered\" message. Same row, fresh send attempt; the\ncompliance gate re-runs inside the service.","operationId":"retry_outreach_reply_api_app_auto_gtm_segments__segment_id__outreach_sent__sent_email_id__retry_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"sent_email_id","in":"path","required":true,"schema":{"type":"string","title":"Sent Email Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/outreach/auto-reply/{person_id}":{"post":{"tags":["outreach"],"summary":"Get Auto Reply Suggestion","description":"LLM-suggested reply for a responsive prospect.\n\nCache-backed (Redis, 7-day TTL, key includes the latest prospect\nmessage_id so a new reply invalidates automatically). On LLM failure\nthe response carries ``suggestion_body: null`` and the frontend falls\nthrough to a plain empty composer.","operationId":"get_auto_reply_suggestion_api_app_auto_gtm_segments__segment_id__outreach_auto_reply__person_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"person_id","in":"path","required":true,"schema":{"type":"string","title":"Person Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/outreach/auto-reply/{row_id}":{"patch":{"tags":["outreach"],"summary":"Update Scheduled Auto Reply","description":"Persist a user's Modify edit on a pending autopilot row.\n\nFlips ``auto_reply_state`` from ``scheduled`` to ``edited``;\n``send_after`` is intentionally untouched (Modify keeps the original\ntimer — the user can use Send now to fire immediately or Cancel to\nabort).","operationId":"update_scheduled_auto_reply_api_app_auto_gtm_segments__segment_id__outreach_auto_reply__row_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoReplyUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["outreach"],"summary":"Cancel Scheduled Auto Reply","description":"User-initiated cancel of a pending autopilot row.\n\nTagged with ``cancelled_user`` so dashboards can distinguish a user's\nexplicit override from the system's own ``cancelled_superseded`` sweeps\n(manual reply landed, 2nd prospect reply, segment toggle off, dispatch-\ntime re-check failed).","operationId":"cancel_scheduled_auto_reply_api_app_auto_gtm_segments__segment_id__outreach_auto_reply__row_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/segments/{segment_id}/outreach/auto-reply/{row_id}/send-now":{"post":{"tags":["outreach"],"summary":"Send Scheduled Auto Reply Now","description":"Bump a pending autopilot row's ``send_after`` to NOW().\n\nThe sender worker picks it up on the next ~30 s cycle. We do NOT flip\n``auto_reply_state`` here — that transition happens in the worker on\nsuccessful dispatch (mirrors ``mark_auto_reply_sent_state``).","operationId":"send_scheduled_auto_reply_now_api_app_auto_gtm_segments__segment_id__outreach_auto_reply__row_id__send_now_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"integer","title":"Segment Id"}},{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/outreach/materials":{"post":{"tags":["outreach"],"summary":"Upload Material","description":"Upload a file into ONE project's library. Moderated the same way regardless.\n\n``project_id`` is required (T-1069: materials are strictly project-scoped —\nthe uploading page always knows its project). ``ephemeral=true`` = a one-off\nfile attached inline from the inbox composer for a single reply — it does\nNOT enter the project's materials library and is not AI-described.\n``ephemeral=false`` (default) = a curated library material (``description``\nis a note read by the autopilot agent; AI-drafted if blank).","operationId":"upload_material_api_app_auto_gtm_outreach_materials_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_material_api_app_auto_gtm_outreach_materials_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["outreach"],"summary":"List Materials","description":"List ONE project's curated library materials (excludes one-off composer\nattachments). ``project_id`` is required — there is no org-wide listing\n(T-1069); the org filter stays as defense-in-depth.","operationId":"list_materials_api_app_auto_gtm_outreach_materials_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"integer","title":"Project Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/outreach/materials/{material_id}":{"patch":{"tags":["outreach"],"summary":"Update Material","description":"Edit a material's description (the note the user + autopilot read).","operationId":"update_material_api_app_auto_gtm_outreach_materials__material_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"material_id","in":"path","required":true,"schema":{"type":"string","title":"Material Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaterialPatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["outreach"],"summary":"Delete Material","description":"Soft-delete a material from the org's library.","operationId":"delete_material_api_app_auto_gtm_outreach_materials__material_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"material_id","in":"path","required":true,"schema":{"type":"string","title":"Material Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/outreach/materials/{material_id}/download":{"get":{"tags":["outreach"],"summary":"Download Material","description":"Return a signed download URL for a material.","operationId":"download_material_api_app_auto_gtm_outreach_materials__material_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"material_id","in":"path","required":true,"schema":{"type":"string","title":"Material Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/outreach/domains":{"get":{"tags":["outreach"],"summary":"List Sending Domains","description":"The org's sending domains with their latest DNS verdicts.","operationId":"list_sending_domains_api_app_auto_gtm_outreach_domains_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/outreach/domains/{domain_id}/dns-check":{"post":{"tags":["outreach"],"summary":"Check Sending Domain Dns","description":"\"Check DNS now\": run the SPF/DKIM/DMARC check on one domain.\n\nShares the hourly per-domain budget with the revalidation cron —\n429 when the domain was already checked N times this hour.","operationId":"check_sending_domain_dns_api_app_auto_gtm_outreach_domains__domain_id__dns_check_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"type":"string","title":"Domain Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/outreach/mailboxes":{"get":{"tags":["outreach"],"summary":"List Org Mailboxes","description":"The org's own (dedicated) mailboxes for the domains tab.\n\nOutside the T-41 rollout gate this is the same empty shell as\n``sending-identity`` — the operator fleet must never leak through here.\n``min_mailboxes`` is the 12-box park threshold so the UI explains the\nsame gate the sync enforces instead of hardcoding its own number.","operationId":"list_org_mailboxes_api_app_auto_gtm_outreach_mailboxes_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["outreach"],"summary":"Connect Byo Mailbox","description":"Connect one BYO SMTP+IMAP mailbox — the UI face of the gateway's\n``POST /v1/mailboxes`` (T-41 PR-3 contract).\n\nThe gateway verifies SMTP login + IMAP select BEFORE inserting anything:\nbad credentials come back as a 422 with a human-readable detail and zero\nrows on either side — we pass that detail through verbatim. On success the\nbox is upserted into the org's park right away (targeted single-box sync)\nand the mailbox's domain gets its ``outreach_organization_domains`` row so\nthe DNS checker starts covering it — no ops step in the loop.\n\nThe body is validated by hand (not as a typed parameter) on purpose:\nFastAPI's default RequestValidationError echoes the submitted body as the\nerror ``input`` — which would put ``app_password`` into a 422 response and\ninto anything that captures 4xx bodies. Field names only, never values.","operationId":"connect_byo_mailbox_api_app_auto_gtm_outreach_mailboxes_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/app-auto-gtm/outreach/mailboxes/{mailbox_id}":{"patch":{"tags":["outreach"],"summary":"Rename Org Mailbox","description":"Rename the From-name of one of the org's own BYO mailboxes — the UI\nface of the gateway's ``PATCH /v1/mailboxes/{id}`` (T-778).\n\nScoped to the caller's own org's ``dedicated`` pool by the lookup below\n(never another org's box, never shared operator inventory) — mirrors\n``list_org_mailboxes``'s WHERE. The gateway rename is a pure DB-row\nupdate (see ``outreach/routers/mailboxes.py`` — no EmailEngine\nre-registration, since ``outreach/routers/send.py`` builds the From\nheader PER SEND straight off the gateway's ``display_name`` column), so\nthis proxy just re-syncs the single local row from the gateway's response\nafterwards, same as the connect proxy.","operationId":"rename_org_mailbox_api_app_auto_gtm_outreach_mailboxes__mailbox_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","title":"Mailbox Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameMailboxRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/outreach/admin/state":{"get":{"tags":["outreach-admin"],"summary":"Admin State","description":"Snapshot of mailbox pacing + queue depth + poller health.","operationId":"admin_state_api_outreach_admin_state_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/outreach/admin/recent":{"get":{"tags":["outreach-admin"],"summary":"Admin Recent","description":"Recent sent_emails feed for the admin sandbox.","operationId":"admin_recent_api_outreach_admin_recent_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"user_email","in":"query","required":false,"schema":{"type":"string","maxLength":254,"default":"","title":"User Email"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/outreach/admin/replies":{"get":{"tags":["outreach-admin"],"summary":"Admin Replies Lookup","description":"Replies feed for the admin sandbox.","operationId":"admin_replies_lookup_api_outreach_admin_replies_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_email","in":"query","required":false,"schema":{"type":"string","maxLength":254,"default":"","title":"User Email"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/outreach/admin/sync-mailboxes":{"post":{"tags":["outreach-admin"],"summary":"Admin Sync Mailboxes","description":"Re-sync the mailbox inventory from the configured provider.","operationId":"admin_sync_mailboxes_api_outreach_admin_sync_mailboxes_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/outreach/admin/bounce-rates":{"get":{"tags":["outreach-admin"],"summary":"Admin Bounce Rates","description":"Bounce rates per-mailbox and per-recipient-domain.","operationId":"admin_bounce_rates_api_outreach_admin_bounce_rates_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"window_days","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":1,"default":7,"title":"Window Days"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/outreach/admin/retire-mailboxes":{"post":{"tags":["outreach-admin"],"summary":"Admin Retire Mailboxes","description":"Permanently take mailboxes out of the pool (terminal ``retired`` status).\n\nFor boxes we are done with (e.g. returning to the vendor). Unlike a pause,\nsurvives the provider sync and cancels queued replies too.\n\nStaff-only on top of the router's ``require_org_admin``: the router gate\npasses any customer who owns their own org, while this action is\nirreversible and fleet-wide (``outreach_mailboxes`` is the shared operator\npool, unscoped by org) — it must never be reachable from a self-serve\naccount.","operationId":"admin_retire_mailboxes_api_outreach_admin_retire_mailboxes_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetireMailboxesBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/outreach/admin/unpause-mailbox/{mailbox_id}":{"post":{"tags":["outreach-admin"],"summary":"Admin Unpause Mailbox","description":"Unpause a mailbox that was auto-paused (e.g. due to high bounce rate).","operationId":"admin_unpause_mailbox_api_outreach_admin_unpause_mailbox__mailbox_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"mailbox_id","in":"path","required":true,"schema":{"type":"string","title":"Mailbox Id"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/outreach/unsubscribe":{"get":{"tags":["outreach-unsubscribe"],"summary":"Unsubscribe Page","description":"Hosted unsubscribe confirmation page.","operationId":"unsubscribe_page_api_outreach_unsubscribe_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"type":"string","default":"","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["outreach-unsubscribe"],"summary":"Unsubscribe Confirm","description":"Process unsubscribe — supports both form POST and RFC 8058 one-click.","operationId":"unsubscribe_confirm_api_outreach_unsubscribe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/outreach/oauth/callback":{"get":{"tags":["OutreachOAuth"],"summary":"Oauth Callback","description":"Receive OAuth auth code from Google after Zapmail completes consent.\n\n``state`` carries the mailbox_id so we know which mailbox to store\ntokens for. Google redirects here after the user (automated by Zapmail)\nclicks \"Allow\" on the consent screen.","operationId":"oauth_callback_api_outreach_oauth_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/outreach/ledger-delivered-sweep":{"post":{"tags":["OutreachInternal"],"summary":"Trigger Ledger Delivered Sweep","description":"One-shot: report settled (non-bounced) sends to the exreacher ledger\nas 'delivered' facts (T-763; T-1961 freshness-gate fuel). Called nightly\nby cron. Sweeps the 3-day window ending 1 day ago in hour slices, deduped\nto one fact per address per 7 days; ledger idempotency + the dedup make\nreruns harmless.","operationId":"trigger_ledger_delivered_sweep_api_internal_outreach_ledger_delivered_sweep_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/outreach/auto-approve-reviews":{"post":{"tags":["OutreachInternal"],"summary":"Trigger Auto Approve Reviews","description":"One-shot: auto-approve stale review segments. Called every ~1min by cron.\n\nReads ``project.auto_approve_timeout_s`` per segment and transitions any\nactive ``agent_chat_review`` row that's older than the timeout and not\ncancelled. Lives under ``/outreach/internal/*`` alongside the other\ncluster-triggered cron endpoints because the deploy tooling already\npoints the scheduler at this path prefix.\n\nThis is an agent_chat cycle (seconds-long) — NOT part of the outreach\ncycles' Prefect migration (T-733); it stays inline with the legacy lock.","operationId":"trigger_auto_approve_reviews_api_internal_outreach_auto_approve_reviews_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/outreach/dns-revalidate":{"post":{"tags":["OutreachInternal"],"summary":"Trigger Dns Revalidate","description":"One-shot: re-check SPF/DKIM/DMARC on all org sending domains (T-41 PR-6).\n\nAdvisory only — verdicts land in outreach_organization_domains.dns_records\nand drive a UI warning, nothing else. No runner flag / cycle lock: the\nvolume is one DNS sweep per org-owned domain, and the CronJob's Forbid\npolicy plus the per-domain hourly rate limit inside check_and_store\nbound the work.","operationId":"trigger_dns_revalidate_api_internal_outreach_dns_revalidate_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/outreach/send-plan-autoscale":{"post":{"tags":["OutreachInternal"],"summary":"Trigger Send Plan Autoscale","description":"T-1185: demand-driven scheduler tick for the send-plan SEND stage —\ncounts the due send frontier and tops Prefect up with flow runs to the\ndemand-derived target (per-run knobs fixed; the deployment's\nconcurrency_limit is the hard cap). External k8s CronJob posts here\nevery minute. Full contract: ``api/outreach/send_plan/autoscaler.py``.\nAlways answers 2xx so the CronJob's ``curl -f`` stays green — a broken\ntick reports its error and the next minute retries.","operationId":"trigger_send_plan_autoscale_api_internal_outreach_send_plan_autoscale_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/outreach/send-plan-enrich-autoscale":{"post":{"tags":["OutreachInternal"],"summary":"Trigger Send Plan Enrich Autoscale","description":"T-733 Ф6: demand-driven scheduler tick for the send-plan ENRICH\nstage — same contract as the send autoscale above (count the due enrich\nfrontier, top Prefect up to the demand-derived target; the deployment's\nconcurrency_limit is the hard cap). Replaces the deployment's five\ninterleaved static crons. External k8s CronJob posts here every minute.\nFull contract: ``api/outreach/send_plan/autoscaler.py``. Always answers\n2xx so the CronJob's ``curl -f`` stays green.","operationId":"trigger_send_plan_enrich_autoscale_api_internal_outreach_send_plan_enrich_autoscale_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/outreach/send-plan-dispatch-tick":{"post":{"tags":["OutreachInternal"],"summary":"Trigger Send Plan Dispatch Tick","description":"T-1282 Phase 0: external minute-cadence trigger for\nsend-plan-rebuild-dispatcher — counts the 'new' rebuild-request queue\nand spawns ONE run unless one is already active. Ships inert: the k8s\nCronJob is suspended until explicit un-suspend (Ф1). Full contract:\n``api/outreach/send_plan/dispatch_tick.py``. Always answers 2xx so the\nCronJob's ``curl -f`` stays green — a broken tick reports its error and\nthe next minute retries.","operationId":"trigger_send_plan_dispatch_tick_api_internal_outreach_send_plan_dispatch_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/outreach/send-plan-reconcile-tick":{"post":{"tags":["OutreachInternal"],"summary":"Trigger Send Plan Reconcile Tick","description":"T-1282 Phase 0: external minute-cadence trigger for\nsend-plan-reconciler — spawns ONE run whenever none is already active\n(the sweep's work signal is a stateless event-detection poll, not a\nqueue count, so idle-only gates it — see\n``api/outreach/send_plan/reconcile_tick.py``'s module docstring). Ships\ninert: the k8s CronJob is suspended until explicit un-suspend (Ф2).\nAlways answers 2xx so the CronJob's ``curl -f`` stays green.","operationId":"trigger_send_plan_reconcile_tick_api_internal_outreach_send_plan_reconcile_tick_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/outreach/send-plan-sla-watchdog":{"post":{"tags":["OutreachInternal"],"summary":"Trigger Send Plan Sla Watchdog","description":"T-1149: SLA watchdog over the send-plan Prefect flows — deployment\nstaleness + draft throughput + rebuild-queue hygiene, alerting #alerts\nwith one-post-per-incident mechanics. External k8s CronJob posts here\nevery 5 min; runs outside the Prefect worker failure domain by design.\nFull contract: ``api/outreach/send_plan/sla_watchdog.py``.","operationId":"trigger_send_plan_sla_watchdog_api_internal_outreach_send_plan_sla_watchdog_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/outreach/egress/register":{"post":{"tags":["OutreachInternal"],"summary":"Egress Register","description":"Upsert a provisioned egress node + its SOCKS IPs into the inventory. IPs\nland ``spare`` (NOT in the send pool); an operator activates them deliberately\nvia the CLI after the RBL/deliverability check.","operationId":"egress_register_api_internal_outreach_egress_register_post","parameters":[{"name":"x-internal-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Internal-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_EgressRegister"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/outreach/egress/refresh":{"post":{"tags":["OutreachInternal"],"summary":"Egress Refresh","description":"Reload the egress IP inventory + domain map immediately (so a status flip\nor a domain switch takes effect now, not at the next sync/send cycle).","operationId":"egress_refresh_api_internal_outreach_egress_refresh_post","parameters":[{"name":"x-internal-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Internal-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/outreach/cycles-health":{"post":{"tags":["OutreachInternal"],"summary":"Trigger Cycles Health","description":"Alert when a watched inline tick stops completing, plus the data-level\noutreach health checks. Called every ~5min by cron.\n\nHeartbeat-wise this now watches ONLY the send-plan external-cadence ticks\n(see ``_WATCHED_TICK_KINDS``) — the recurring outreach cycles live on\nPrefect and their liveness is the SLA watchdog's check 7 (T-733 Ф5).\n\nA heartbeat that was never written (cold start) is primed to \"now\" on\nfirst sight instead of alerting — measurement starts from there.","operationId":"trigger_cycles_health_api_internal_outreach_cycles_health_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/outreach/deliverability-report":{"post":{"tags":["OutreachInternal"],"summary":"Trigger Deliverability Report","description":"Build the daily deliverability snapshot (recipient-ESP + ESP-match cuts,\neach for a 7d and a 24h window) and post it to ``#notifications``.\n\nThe recipient-ESP resolution is heavy (~3 min over ~400k sends) so it runs\nin a worker thread, off the event loop; the cron curls with a long ``-m``\nand the CronJob's ``activeDeadlineSeconds`` bounds the pod. Best-effort —\nnever raises into the cron.","operationId":"trigger_deliverability_report_api_internal_outreach_deliverability_report_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/internal/outreach/pacing-violations":{"get":{"tags":["OutreachInternal"],"summary":"Get Pacing Violations","description":"On-demand unified-pacing invariant snapshot (3 buckets + denominators).","operationId":"get_pacing_violations_api_internal_outreach_pacing_violations_get","parameters":[{"name":"window_min","in":"query","required":false,"schema":{"type":"integer","default":60,"title":"Window Min"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/outreach/exreacher-callback":{"post":{"tags":["OutreachInternal"],"summary":"Exreacher Callback","description":"Receive an async catch_all-revalidation result from exreacher and upgrade\nEVERY matching lead — the result carries the validated email, and a repeated\ncatch_all has several agent_lead rows across projects, so all of them (in\nactively-sending ``outreach`` segments) move to the new status. Network-gated\nlike the rest of this router; an optional shared secret\n(`EXREACHER_CALLBACK_SECRET`) is checked when configured.","operationId":"exreacher_callback_api_internal_outreach_exreacher_callback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ExreacherCallbackBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Exreacher Callback Api Internal Outreach Exreacher Callback Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/outreach/parity/cohort-volumes":{"get":{"tags":["OutreachParity"],"summary":"Get Cohort Volumes","operationId":"get_cohort_volumes_api_internal_outreach_parity_cohort_volumes_get","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/outreach/parity/window-correctness":{"get":{"tags":["OutreachParity"],"summary":"Get Window Correctness","operationId":"get_window_correctness_api_internal_outreach_parity_window_correctness_get","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/outreach/parity/mailbox-validity":{"get":{"tags":["OutreachParity"],"summary":"Get Mailbox Assignment Validity","operationId":"get_mailbox_assignment_validity_api_internal_outreach_parity_mailbox_validity_get","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/outreach/parity/surplus-share":{"get":{"tags":["OutreachParity"],"summary":"Get Surplus Over Budget Share","operationId":"get_surplus_over_budget_share_api_internal_outreach_parity_surplus_share_get","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/outreach/parity/hourly-readiness":{"get":{"tags":["OutreachParity"],"summary":"Get Hourly Readiness Vs Capacity","operationId":"get_hourly_readiness_vs_capacity_api_internal_outreach_parity_hourly_readiness_get","parameters":[{"name":"plan_date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Plan Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/outreach/parity/fr-parity":{"get":{"tags":["OutreachParity"],"summary":"Get Fr Planning Parity","operationId":"get_fr_planning_parity_api_internal_outreach_parity_fr_parity_get","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/linkedin-poc/status":{"get":{"tags":["LinkedInPoC"],"summary":"Get Status","description":"Return token presence, live accounts from transport(s), and total sent count.","operationId":"get_status_api_linkedin_poc_status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/linkedin-poc/bootstrap":{"post":{"tags":["LinkedInPoC"],"summary":"Post Bootstrap","description":"Refresh routing from the transport(s) and bootstrap the GetSales workspace.\n\nFor each GetSalesTransport: runs bootstrap_workspace() + ensure_connect_flow().\nThe last values seen are returned; with a single workspace token there is only one.","operationId":"post_bootstrap_api_linkedin_poc_bootstrap_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__outreach_linkedin__router__BootstrapResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/linkedin-poc/invites":{"post":{"tags":["LinkedInPoC"],"summary":"Post Invites","description":"Enqueue connection-request invites for a list of LinkedIn profile URLs.\n\nBefore sending: refreshes routing and (for GetSalesTransport) bootstraps the\nworkspace + ensures the connect flow. Per-URL failures are recorded as\nok=false rows rather than aborting the whole request.","operationId":"post_invites_api_linkedin_poc_invites_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/linkedin-poc/sent":{"get":{"tags":["LinkedInPoC"],"summary":"Get Sent","description":"Return the most-recent sent rows, newest first.","operationId":"get_sent_api_linkedin_poc_sent_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/linkedin-poc/sync-states":{"post":{"tags":["LinkedInPoC"],"summary":"Post Sync States","description":"Poll every transport for lead states and update connection_state in the DB.\n\nFor each lead whose connection was accepted or lost since the last sync,\nthe ``outreach_linkedin_sent`` row is updated.  Returns the full list of\nstate transitions seen, plus a convenience ``accepted_count`` of rows\nthat changed to 'accepted'.","operationId":"post_sync_states_api_linkedin_poc_sync_states_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncStatesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/linkedin-poc/dm":{"post":{"tags":["LinkedInPoC"],"summary":"Post Dm","description":"Send a DM to a prospect whose connection request was accepted.\n\n``sent_id`` must be the UUID of an existing ``kind='connection_request'``\nrow whose ``connection_state`` is 'accepted'.  Returns the DM result; a\ntransport-level failure is surfaced as ``ok=false`` in the body rather\nthan an HTTP error so the UI can display the error without extra handling.","operationId":"post_dm_api_linkedin_poc_dm_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DmRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DmResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/linkedin-poc/inbox/contacts":{"get":{"tags":["LinkedInPoC"],"summary":"Get Inbox Contacts","description":"Return all contacts with channel statuses and inbox aggregates.\n\nEach contact gains ``sender_name`` (resolved from the TTL cache of live\nsender accounts) and ``lead_name`` (from agent_lead.raw_person via\nperson_id, when available).","operationId":"get_inbox_contacts_api_linkedin_poc_inbox_contacts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxContactsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/linkedin-poc/inbox/thread":{"get":{"tags":["LinkedInPoC"],"summary":"Get Inbox Thread","description":"Return the full outbound+inbound thread for one contact.\n\nThe contact object gains ``sender_name`` / ``lead_name`` (same as the\ncontacts list).  Each outbound message gains ``sender_name`` resolved\nfrom the TTL cache; inbound messages get ``sender_name=null`` (the\nfrontend uses the contact name instead).","operationId":"get_inbox_thread_api_linkedin_poc_inbox_thread_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"profile_url","in":"query","required":true,"schema":{"type":"string","title":"Profile Url"}},{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"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/linkedin-poc/inbox/send":{"post":{"tags":["LinkedInPoC"],"summary":"Post Inbox Send","description":"Send a DM to a contact identified by profile_url.\n\nResolves the latest connection_request row for the profile_url (404 if\nnone), rejects with 409 if not yet accepted, then sends via the pool\nexactly like /dm.","operationId":"post_inbox_send_api_linkedin_poc_inbox_send_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxSendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxSendResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/linkedin-poc/inbox/sync":{"post":{"tags":["LinkedInPoC"],"summary":"Post Inbox Sync","description":"Refresh routing, sync connection states, and ingest inbound messages.\n\nReturns accepted_count (newly accepted connections) and new_inbound\n(newly inserted reply rows).","operationId":"post_inbox_sync_api_linkedin_poc_inbox_sync_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ex_access","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Access"}},{"name":"ex_org","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ex Org"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxSyncResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/health":{"get":{"summary":"Health Check","operationId":"health_check_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AccountOut":{"properties":{"account_ref":{"type":"string","title":"Account Ref"},"provider":{"type":"string","title":"Provider"},"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"status":{"type":"string","title":"Status"},"safety_managed":{"type":"boolean","title":"Safety Managed"}},"type":"object","required":["account_ref","provider","first_name","last_name","status","safety_managed"],"title":"AccountOut"},"ActivateSubscriptionRequest":{"properties":{"device_id":{"type":"string","title":"Device Id"},"email":{"type":"string","title":"Email","default":""},"email_consent":{"type":"boolean","title":"Email Consent","default":false}},"type":"object","required":["device_id"],"title":"ActivateSubscriptionRequest"},"AddLeadStatusRequest":{"properties":{"name":{"type":"string","title":"Name"},"color":{"type":"string","title":"Color","default":"#64748b"}},"type":"object","required":["name"],"title":"AddLeadStatusRequest"},"AgentInfo":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"category":{"type":"string","title":"Category"},"sample_input_headers":{"items":{"type":"string"},"type":"array","title":"Sample Input Headers"},"sample_output_keys":{"items":{"type":"string"},"type":"array","title":"Sample Output Keys"},"example_csv":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Example Csv"},"input_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Schema"},"output_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output Schema"}},"type":"object","required":["id","name","description","category","sample_input_headers","sample_output_keys","example_csv"],"title":"AgentInfo"},"ApplicationRequest":{"properties":{"vacancy_slug":{"type":"string","maxLength":64,"title":"Vacancy Slug"},"name":{"type":"string","maxLength":200,"title":"Name","default":""},"contact":{"type":"string","maxLength":300,"title":"Contact","default":""},"linkedin":{"type":"string","maxLength":500,"title":"Linkedin","default":""},"built_with_ai":{"type":"string","maxLength":4000,"title":"Built With Ai","default":""},"letter":{"type":"string","maxLength":8000,"title":"Letter","default":""},"best_link":{"type":"string","maxLength":500,"title":"Best Link","default":""},"cv_filename":{"type":"string","maxLength":300,"title":"Cv Filename","default":""},"cv_base64":{"type":"string","maxLength":6990514,"title":"Cv Base64","default":""},"ref":{"type":"string","maxLength":64,"title":"Ref","default":""},"website":{"type":"string","maxLength":500,"title":"Website","default":""}},"type":"object","required":["vacancy_slug"],"title":"ApplicationRequest","description":"The public application form (web/app/jobs/apply.ts). Every candidate\nfield is optional by product decision (super-easy form) — the endpoint only\ninsists on some way to reach back. Length caps mirror the form's maxlength\nattributes; this endpoint is public, so every field is bounded."},"ArchivedProjectSummary":{"properties":{"id":{"type":"integer","title":"Id"},"domain":{"type":"string","title":"Domain"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Archived At"}},"type":"object","required":["id","domain"],"title":"ArchivedProjectSummary","description":"A row of the sidebar's \"Archived\" list — label + Restore is all it\nbacks, so no segments are embedded (unlike ProjectSummary)."},"ArmSpec":{"properties":{"label":{"type":"string","title":"Label"},"weight":{"type":"integer","title":"Weight","default":1},"change":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change"}},"type":"object","required":["label"],"title":"ArmSpec"},"AssignBody":{"properties":{"subject_type":{"type":"string","title":"Subject Type"},"subject_id":{"type":"string","title":"Subject Id"},"attrs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Attrs"}},"type":"object","required":["subject_type","subject_id"],"title":"AssignBody"},"AutoReplyUpdateRequest":{"properties":{"body_text":{"type":"string","title":"Body Text"}},"type":"object","required":["body_text"],"title":"AutoReplyUpdateRequest"},"AutoTopupTickResponse":{"properties":{"scanned":{"type":"integer","title":"Scanned","default":0},"charged":{"type":"integer","title":"Charged","default":0},"settled_from_wallet":{"type":"integer","title":"Settled From Wallet","default":0},"failed":{"type":"integer","title":"Failed","default":0},"errors":{"type":"integer","title":"Errors","default":0},"skipped_locked":{"type":"integer","title":"Skipped Locked","default":0},"deferred":{"type":"integer","title":"Deferred","default":0},"emailed_failed":{"type":"integer","title":"Emailed Failed","default":0},"skipped":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skipped"},"no_funds_scanned":{"type":"integer","title":"No Funds Scanned","default":0},"no_funds_emailed":{"type":"integer","title":"No Funds Emailed","default":0},"no_funds_cancelled":{"type":"integer","title":"No Funds Cancelled","default":0},"no_funds_skipped_locked":{"type":"integer","title":"No Funds Skipped Locked","default":0},"no_funds_deferred":{"type":"integer","title":"No Funds Deferred","default":0},"bp_resume_scanned":{"type":"integer","title":"Bp Resume Scanned","default":0},"bp_resume_orgs":{"type":"integer","title":"Bp Resume Orgs","default":0},"bp_resume_segments":{"type":"integer","title":"Bp Resume Segments","default":0},"debt_resume_scanned":{"type":"integer","title":"Debt Resume Scanned","default":0},"debt_resume_orgs":{"type":"integer","title":"Debt Resume Orgs","default":0},"debt_resume_segments":{"type":"integer","title":"Debt Resume Segments","default":0}},"type":"object","title":"AutoTopupTickResponse","description":"Counters from one auto-topup cron pass. ``skipped`` is set to a\nshort reason string when the handler took no action at all (e.g. the\nself-lock was already held)."},"AutopilotActivityItem":{"properties":{"id":{"type":"string","title":"Id"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"},"kind":{"type":"string","enum":["created","launched","resumed","paused","budget_raised","budget_lowered","re_search"],"title":"Kind"},"campaign_name":{"type":"string","title":"Campaign Name"},"segment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Segment Id"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"previous_budget_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Previous Budget Usd"},"new_budget_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"New Budget Usd"}},"type":"object","required":["id","occurred_at","kind","campaign_name"],"title":"AutopilotActivityItem"},"AutopilotActivityResponse":{"properties":{"project_id":{"type":"integer","title":"Project Id"},"actions":{"items":{"$ref":"#/components/schemas/AutopilotActivityItem"},"type":"array","title":"Actions"}},"type":"object","required":["project_id","actions"],"title":"AutopilotActivityResponse"},"AvailableFilter":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["key","label","count"],"title":"AvailableFilter","description":"One chip in the All replies tab's filter row.\n\n`key` is the canonical intent name (matches ``?intent=`` query param).\n`label`, `icon`, and `description` are display-only; the frontend reads\n`icon` as a Lucide component name via a small switch and renders\n`description` as the chip's hover tooltip."},"BalanceTile":{"properties":{"balance_usd":{"type":"number","title":"Balance Usd"},"balance_credits":{"type":"number","title":"Balance Credits"},"is_empty":{"type":"boolean","title":"Is Empty"},"is_low":{"type":"boolean","title":"Is Low"}},"type":"object","required":["balance_usd","balance_credits","is_empty","is_low"],"title":"BalanceTile","description":"The org wallet, shown on the dashboard's budget tile (T-2710).\n\nThe verdicts are the SERVER's: ``is_low`` / ``is_empty`` are read off the\nsame billing constants the Billing page uses, never re-derived on the\nclient — two thresholds for one wallet is the drift the T-642 invariant\nbans. ``is_empty`` (below one email's cost) implies ``is_low``; an org in\ndebt has a negative balance, so both read true."},"BatchLaunchItem":{"properties":{"segment_id":{"type":"integer","title":"Segment Id"},"daily_limit_usd":{"type":"integer","maximum":300.0,"minimum":1.0,"title":"Daily Limit Usd"},"target_url":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Target Url"}},"type":"object","required":["segment_id","daily_limit_usd"],"title":"BatchLaunchItem"},"BatchLaunchRequest":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BatchLaunchItem"},"type":"array","maxItems":20,"minItems":1,"title":"Items"}},"type":"object","required":["items"],"title":"BatchLaunchRequest"},"BatchLaunchResponse":{"properties":{"segment_ids":{"items":{"type":"integer"},"type":"array","title":"Segment Ids"}},"type":"object","required":["segment_ids"],"title":"BatchLaunchResponse"},"BillingBalanceResponse":{"properties":{"balance_usd":{"type":"number","title":"Balance Usd"},"balance_credits":{"type":"number","title":"Balance Credits"},"is_empty":{"type":"boolean","title":"Is Empty"},"is_low":{"type":"boolean","title":"Is Low"}},"type":"object","required":["balance_usd","balance_credits","is_empty","is_low"],"title":"BillingBalanceResponse","description":"Org wallet balance snapshot for the inbox banner + composer gate.\n\n`balance_credits` is the raw wallet figure (1 credit = $0.01); the\nderived USD value is convenient for UI rendering. The two booleans\nencode the thresholds the UI cares about — kept on the server so the\nthreshold definition stays a single source of truth:\n\n- `is_empty`: balance below the per-email cost. The composer pre-send\n  precheck will return 402 in this state. The inbox banner renders\n  red (\"wallet empty — replies cannot send\").\n- `is_low`: balance below a buffer threshold (~16 emails). The inbox\n  banner renders yellow (\"low balance, top up soon\"). Always true\n  when `is_empty` is true.\n\nExcludes postpaid headroom — that lives on\n:class:`PostpaidStateResponse` since it's a credit limit, not money\nin the user's prepaid wallet."},"BlockedDomainSourceEntries":{"properties":{"total":{"type":"integer","title":"Total"},"showing":{"type":"integer","title":"Showing"},"domains":{"items":{"type":"string"},"type":"array","title":"Domains"}},"type":"object","required":["total","showing","domains"],"title":"BlockedDomainSourceEntries"},"BlockedDomainsAddRequest":{"properties":{"domains":{"items":{"type":"string","maxLength":2048},"type":"array","maxItems":10000,"minItems":1,"title":"Domains"}},"type":"object","required":["domains"],"title":"BlockedDomainsAddRequest","description":"Manual add on the Suppress list page. The client pre-parses free text\ninto candidate tokens; the server re-normalizes each one anyway. The list\ncap mirrors the CSV import's MAX_DOMAINS_PER_ADD (pinned by test); the\nper-item cap matches str_to_domain's own 2048-char input cutoff."},"BlockedDomainsImportResponse":{"properties":{"source_name":{"type":"string","title":"Source Name"},"imported":{"type":"integer","title":"Imported"},"skipped":{"type":"integer","title":"Skipped"},"invalid":{"type":"integer","title":"Invalid"}},"type":"object","required":["source_name","imported","skipped","invalid"],"title":"BlockedDomainsImportResponse"},"Body_byol_import_leads_api_app_auto_gtm_leads_byol_import_post":{"properties":{"project_id":{"type":"integer","title":"Project Id"},"campaign_name":{"type":"string","title":"Campaign Name"},"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["project_id","campaign_name","file"],"title":"Body_byol_import_leads_api_app_auto_gtm_leads_byol_import_post"},"Body_dedup_domains_import_api_app_auto_gtm_dedup_domains_import_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_dedup_domains_import_api_app_auto_gtm_dedup_domains_import_post"},"Body_dedup_import_api_app_auto_gtm_dedup_import_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_dedup_import_api_app_auto_gtm_dedup_import_post"},"Body_leads_import_api_leads_import_post":{"properties":{"name":{"type":"string","title":"Name"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"domain":{"type":"string","title":"Domain"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["name","domain","file"],"title":"Body_leads_import_api_leads_import_post"},"Body_leads_import_suggestions_api_leads_import_suggestions_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_leads_import_suggestions_api_leads_import_suggestions_post"},"Body_upload_material_api_app_auto_gtm_outreach_materials_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"project_id":{"type":"integer","title":"Project Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"ephemeral":{"type":"boolean","title":"Ephemeral","default":false}},"type":"object","required":["file","project_id"],"title":"Body_upload_material_api_app_auto_gtm_outreach_materials_post"},"BootstrapRequest":{"properties":{"device_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Device Id"},"missing":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Missing"},"overrides":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Overrides"}},"type":"object","title":"BootstrapRequest"},"BudgetTierItem":{"properties":{"key":{"type":"string","enum":["light","typical","growth","power"],"title":"Key"},"max_usd":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Usd"},"label":{"type":"string","title":"Label"},"hint":{"type":"string","title":"Hint"}},"type":"object","required":["key","max_usd","label","hint"],"title":"BudgetTierItem","description":"One verdict tier for the daily-budget slider.\n\n`max_usd is None` marks the open-ended top tier — consumers pick the\nfirst tier with `usd < max_usd`, falling back to the open one."},"BulkRetargetRequest":{"properties":{"target_geo":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Target Geo"},"target_company_size":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Target Company Size"},"segment_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"Segment Ids"}},"type":"object","required":["segment_ids"],"title":"BulkRetargetRequest","description":"Apply one targeting to a whole set of campaigns in a single request.\n\nThe \"use the same targeting for every campaign\" path of the Targeting screen\n(T-286): one call carries the campaigns to apply to, instead of the browser\nfiring one POST /segments/{id}/retarget per campaign. Inherits the geo /\ncompany-size prompts (+ trimming) from RetargetRequest; adds the segment set.\nMirrors the project-scoped save-templates / save-links \"apply to all\" pattern."},"BulkRetargetResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/RetargetResponse"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"BulkRetargetResponse"},"CalendarAvailabilityRequest":{"properties":{"project":{"type":"string","title":"Project"},"slots":{"items":{"type":"string"},"type":"array","title":"Slots"},"timezone":{"type":"string","title":"Timezone","default":"UTC"}},"type":"object","required":["project","slots"],"title":"CalendarAvailabilityRequest"},"CampaignRollupItem":{"properties":{"segment_id":{"type":"integer","title":"Segment Id"},"campaign_name":{"type":"string","title":"Campaign Name"},"status":{"type":"string","title":"Status"},"emails_sent":{"type":"integer","title":"Emails Sent"},"total_replies":{"type":"integer","title":"Total Replies"},"reply_rate_pct":{"type":"number","title":"Reply Rate Pct"},"hot_leads":{"type":"integer","title":"Hot Leads"},"spend_usd":{"type":"number","title":"Spend Usd"},"cost_per_lead_usd":{"type":"number","title":"Cost Per Lead Usd"},"daily_budget_usd":{"type":"number","title":"Daily Budget Usd"},"subtext":{"type":"string","title":"Subtext"},"pool_used":{"type":"integer","title":"Pool Used"},"pool_total":{"type":"integer","title":"Pool Total"},"pool_pending":{"type":"integer","title":"Pool Pending","default":0},"status_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Reason"},"status_display":{"anyOf":[{"$ref":"#/components/schemas/StatusDisplay"},{"type":"null"}]},"manual_status_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Manual Status Counts","default":{}},"cold_lost":{"type":"integer","title":"Cold Lost","default":0},"emails_sent_7d":{"type":"integer","title":"Emails Sent 7D","default":0},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"}},"type":"object","required":["segment_id","campaign_name","status","emails_sent","total_replies","reply_rate_pct","hot_leads","spend_usd","cost_per_lead_usd","daily_budget_usd","subtext","pool_used","pool_total"],"title":"CampaignRollupItem"},"CapiEvent":{"properties":{"event_name":{"type":"string","title":"Event Name"},"event_id":{"type":"string","title":"Event Id"},"event_source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Source Url"},"custom_data":{"additionalProperties":true,"type":"object","title":"Custom Data","default":{}},"device_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"fbp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fbp"},"fbc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fbc"}},"additionalProperties":true,"type":"object","required":["event_name","event_id"],"title":"CapiEvent"},"CcValidationIssue":{"properties":{"email":{"type":"string","title":"Email"},"reason":{"type":"string","enum":["syntax","domain"],"title":"Reason"}},"type":"object","required":["email","reason"],"title":"CcValidationIssue"},"CcValidationRequest":{"properties":{"cc_emails":{"items":{"type":"string","format":"email"},"type":"array","maxItems":20,"minItems":1,"title":"Cc Emails"}},"type":"object","required":["cc_emails"],"title":"CcValidationRequest"},"CcValidationResponse":{"properties":{"invalid":{"items":{"$ref":"#/components/schemas/CcValidationIssue"},"type":"array","title":"Invalid"}},"type":"object","required":["invalid"],"title":"CcValidationResponse"},"CheckoutPayload":{"properties":{"credits":{"type":"integer","title":"Credits"},"success_url":{"type":"string","title":"Success Url","default":"https://explee.com/top-up/success"},"cancel_url":{"type":"string","title":"Cancel Url","default":"https://explee.com/top-up/canceled"},"redirect_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Url"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"bypass_plan_restriction":{"type":"boolean","title":"Bypass Plan Restriction","default":false},"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Key"}},"type":"object","required":["credits"],"title":"CheckoutPayload"},"CommandInput":{"properties":{"kind":{"type":"string","const":"command","title":"Kind","default":"command"},"command":{"type":"string","enum":["pause","resume","stop"],"title":"Command"},"step_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Step Id"}},"type":"object","required":["command"],"title":"CommandInput"},"CompaniesEstimateStatsPayload":{"properties":{"filters":{"additionalProperties":true,"type":"object","title":"Filters"},"clusterization":{"type":"boolean","title":"Clusterization","default":false}},"type":"object","required":["filters"],"title":"CompaniesEstimateStatsPayload"},"CompaniesSearchFilters":{"properties":{"definition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Definition"},"definition_exclude":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Definition Exclude"},"min_relevance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Relevance"},"definition_ids_exclude":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Definition Ids Exclude"},"geo_include":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Geo Include"},"geo_exclude":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Geo Exclude"},"geo_include_empty":{"type":"boolean","title":"Geo Include Empty","default":false},"geo_subdivision":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Geo Subdivision"},"geo_city":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Geo City"},"geo_subdivision_exclude":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Geo Subdivision Exclude"},"geo_city_exclude":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Geo City Exclude"},"geo_founders":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Geo Founders"},"location_hq":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Location Hq"},"location_customer":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Location Customer"},"founded":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Founded"},"size":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Size"},"size_on_linkedin":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Size On Linkedin"},"revenue_annual":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Revenue Annual"},"is_b2b":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is B2B"},"is_saas":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Saas"},"is_startup":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Startup"},"is_tech":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Tech"},"is_merchant":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Merchant"},"is_digital":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Digital"},"is_ai":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Ai"},"is_alive_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Is Alive Min"},"is_alive":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Alive"},"geo_employee_distribution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geo Employee Distribution"},"geo_employees_country_count_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Geo Employees Country Count Min"},"employees_growth":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Employees Growth"},"hiring_is":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hiring Is"},"funding_last_round_stage":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Funding Last Round Stage"},"funding_last_round_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Funding Last Round Date"},"technologies":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Technologies"},"traffic":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Traffic"},"traffic_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Traffic Min"},"traffic_max":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Traffic Max"},"geo_countries_traffic":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Geo Countries Traffic"},"traffic_growth":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Traffic Growth"},"is_b2b_score":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Is B2B Score"},"is_b2b_agency_score":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Is B2B Agency Score"},"is_explee_customer":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Is Explee Customer"},"size_gm_branches":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Size Gm Branches"},"size_gm_reviews":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Size Gm Reviews"},"employees_by_department":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Employees By Department"},"industry_nace_section":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry Nace Section"},"industry_nace_classes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Industry Nace Classes"},"has_public_emails":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Public Emails"},"has_company_phone":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Company Phone"},"has_linkedin_page":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Linkedin Page"},"has_employees_on_linkedin":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Employees On Linkedin"},"sources":{"anyOf":[{"items":{"type":"string","enum":["web","linkedin"]},"type":"array"},{"type":"null"}],"title":"Sources"},"criteria":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Criteria"}},"type":"object","title":"CompaniesSearchFilters"},"CompaniesSearchPayload":{"properties":{"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"},"filters":{"additionalProperties":true,"type":"object","title":"Filters"},"clusterization":{"type":"boolean","title":"Clusterization","default":false},"page":{"type":"integer","title":"Page","default":1},"order_by":{"type":"string","enum":["relevance","match"],"title":"Order By","default":"relevance"},"deduplication":{"anyOf":[{"$ref":"#/components/schemas/DeduplicationSettings"},{"type":"null"}]},"company_columns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Company Columns"},"extra_columns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extra Columns"}},"type":"object","required":["filters"],"title":"CompaniesSearchPayload"},"ConnectUrlResponse":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"ConnectUrlResponse"},"CouponRedeemPayload":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"CouponRedeemPayload"},"CreateApiKeyRequest":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"CreateApiKeyRequest"},"CreateHistoryItemPayload":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"companies_filters":{"anyOf":[{"$ref":"#/components/schemas/CompaniesSearchFilters"},{"type":"null"}]},"people_filters":{"anyOf":[{"$ref":"#/components/schemas/PeopleSearchFilters"},{"type":"null"}]},"deduplication":{"anyOf":[{"$ref":"#/components/schemas/DeduplicationSettings"},{"type":"null"}]},"extra_columns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extra Columns"}},"type":"object","required":["id","name"],"title":"CreateHistoryItemPayload"},"CreateProjectRequest":{"properties":{"domain":{"type":"string","maxLength":253,"minLength":3,"title":"Domain"}},"type":"object","required":["domain"],"title":"CreateProjectRequest"},"CreateProjectResponse":{"properties":{"project_id":{"type":"integer","title":"Project Id"}},"type":"object","required":["project_id"],"title":"CreateProjectResponse"},"CreateSegmentRequest":{"properties":{"project_id":{"type":"integer","title":"Project Id"},"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name"}},"type":"object","required":["project_id","name"],"title":"CreateSegmentRequest","description":"Body for POST /segments — manual segment creation from the sidebar.\nAll ICP fields are filled in afterwards via PATCH on the Docs tab; this\nendpoint only seeds an empty row so the user has somewhere to type into."},"CreateTaskRequest":{"properties":{"agent_id":{"type":"string","maxLength":128,"minLength":1,"title":"Agent Id"},"headers":{"items":{"type":"string"},"type":"array","title":"Headers"},"rows":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Rows"}},"type":"object","required":["agent_id","headers","rows"],"title":"CreateTaskRequest"},"CreateTaskResponse":{"properties":{"task_id":{"type":"string","title":"Task Id"}},"type":"object","required":["task_id"],"title":"CreateTaskResponse"},"CreditActivityItem":{"properties":{"label":{"type":"string","title":"Label"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"amount_usd":{"type":"number","title":"Amount Usd"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"kind":{"type":"string","enum":["paid","bonus"],"title":"Kind"}},"type":"object","required":["label","amount_usd","occurred_at","kind"],"title":"CreditActivityItem","description":"One credit deposit on the Billing page's \"Credits activity\" list —\nanswers \"where did my balance come from\" (trial, referral, top-up…)."},"CreditsActivityResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CreditActivityItem"},"type":"array","title":"Items","default":[]}},"type":"object","title":"CreditsActivityResponse"},"CtaAutoReply":{"properties":{"type":{"type":"string","const":"auto_reply","title":"Type","default":"auto_reply"}},"type":"object","title":"CtaAutoReply"},"CtaAutopilot":{"properties":{"type":{"type":"string","const":"autopilot","title":"Type","default":"autopilot"}},"type":"object","title":"CtaAutopilot"},"CtaBilling":{"properties":{"type":{"type":"string","const":"billing","title":"Type","default":"billing"},"payload":{"$ref":"#/components/schemas/CtaBillingPayload"}},"type":"object","required":["payload"],"title":"CtaBilling"},"CtaBillingPayload":{"properties":{"running_campaigns_count":{"type":"integer","title":"Running Campaigns Count"}},"type":"object","required":["running_campaigns_count"],"title":"CtaBillingPayload"},"CtaInbox":{"properties":{"type":{"type":"string","const":"inbox","title":"Type","default":"inbox"},"payload":{"$ref":"#/components/schemas/CtaInboxPayload"}},"type":"object","required":["payload"],"title":"CtaInbox"},"CtaInboxPayload":{"properties":{"hot_count":{"type":"integer","title":"Hot Count"},"people":{"items":{"$ref":"#/components/schemas/CtaPerson"},"type":"array","title":"People"}},"type":"object","required":["hot_count","people"],"title":"CtaInboxPayload"},"CtaNoCard":{"properties":{"type":{"type":"string","const":"no_card","title":"Type","default":"no_card"},"payload":{"$ref":"#/components/schemas/CtaNoCardPayload"}},"type":"object","required":["payload"],"title":"CtaNoCard"},"CtaNoCardPayload":{"properties":{"running_campaigns_count":{"type":"integer","title":"Running Campaigns Count"},"prepaid_covered":{"type":"boolean","title":"Prepaid Covered","default":false}},"type":"object","required":["running_campaigns_count"],"title":"CtaNoCardPayload"},"CtaPerson":{"properties":{"person_id":{"type":"string","title":"Person Id"},"person_name":{"type":"string","title":"Person Name"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"received_at":{"type":"string","title":"Received At"}},"type":"object","required":["person_id","person_name","received_at"],"title":"CtaPerson","description":"One avatar + name shown in the Inbox CTA (max 3, freshest first)."},"CtaReferral":{"properties":{"type":{"type":"string","const":"referral","title":"Type","default":"referral"}},"type":"object","title":"CtaReferral"},"CtaSetupStep":{"properties":{"type":{"type":"string","const":"setup_step","title":"Type","default":"setup_step"},"payload":{"$ref":"#/components/schemas/CtaSetupStepPayload"}},"type":"object","required":["payload"],"title":"CtaSetupStep"},"CtaSetupStepPayload":{"properties":{"step":{"type":"string","enum":["csv_import","hubspot","api_key"],"title":"Step"}},"type":"object","required":["step"],"title":"CtaSetupStepPayload"},"CtaZeroBudget":{"properties":{"type":{"type":"string","const":"zero_budget","title":"Type","default":"zero_budget"},"payload":{"$ref":"#/components/schemas/CtaZeroBudgetPayload"}},"type":"object","required":["payload"],"title":"CtaZeroBudget"},"CtaZeroBudgetPayload":{"properties":{"running_campaigns_count":{"type":"integer","title":"Running Campaigns Count"},"suggested_budget_usd":{"type":"integer","title":"Suggested Budget Usd"}},"type":"object","required":["running_campaigns_count","suggested_budget_usd"],"title":"CtaZeroBudgetPayload"},"DailyBreakdownItem":{"properties":{"day":{"type":"string","format":"date","title":"Day"},"emails_sent":{"type":"integer","title":"Emails Sent"},"spend_usd":{"type":"number","title":"Spend Usd"},"replies":{"type":"integer","title":"Replies","default":0},"reply_rate_pct":{"type":"number","title":"Reply Rate Pct","default":0.0},"hot_leads":{"type":"integer","title":"Hot Leads","default":0},"engaged_count":{"type":"integer","title":"Engaged Count","default":0},"engaged_pct":{"type":"integer","title":"Engaged Pct","default":0},"cost_per_lead_usd":{"type":"number","title":"Cost Per Lead Usd","default":0.0}},"type":"object","required":["day","emails_sent","spend_usd"],"title":"DailyBreakdownItem","description":"Emails + replies + hot-lead + engagement metrics for one calendar day."},"DedupDeleteResponse":{"properties":{"deleted":{"type":"integer","title":"Deleted"}},"type":"object","required":["deleted"],"title":"DedupDeleteResponse"},"DedupImportResponse":{"properties":{"source_name":{"type":"string","title":"Source Name"},"imported":{"type":"integer","title":"Imported"},"skipped":{"type":"integer","title":"Skipped"},"detected_columns":{"additionalProperties":{"type":"string"},"type":"object","title":"Detected Columns"}},"type":"object","required":["source_name","imported","skipped","detected_columns"],"title":"DedupImportResponse"},"DedupListsResponse":{"properties":{"sources":{"items":{"$ref":"#/components/schemas/DedupSourceSummary"},"type":"array","title":"Sources"}},"type":"object","required":["sources"],"title":"DedupListsResponse"},"DedupPersonEntry":{"properties":{"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"linkedin_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linkedin Url"},"company_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Domain"}},"type":"object","title":"DedupPersonEntry"},"DedupSourceEntries":{"properties":{"total":{"type":"integer","title":"Total"},"showing":{"type":"integer","title":"Showing"},"entries":{"items":{"$ref":"#/components/schemas/DedupPersonEntry"},"type":"array","title":"Entries"}},"type":"object","required":["total","showing","entries"],"title":"DedupSourceEntries"},"DedupSourceSummary":{"properties":{"source_name":{"type":"string","title":"Source Name"},"count":{"type":"integer","title":"Count"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["source_name","count","created_at"],"title":"DedupSourceSummary"},"DeduplicationSettings":{"properties":{"export_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Export Ids"},"import_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Import Ids"},"dedup_new":{"type":"boolean","title":"Dedup New","default":true},"dedup_people_by_companies":{"type":"boolean","title":"Dedup People By Companies","default":false},"cache":{"type":"boolean","title":"Cache","default":true}},"type":"object","title":"DeduplicationSettings"},"DigestDailyTickResponse":{"properties":{"scanned":{"type":"integer","title":"Scanned","default":0},"sent":{"type":"integer","title":"Sent","default":0},"skipped_weekend":{"type":"integer","title":"Skipped Weekend","default":0},"skipped_not_in_window":{"type":"integer","title":"Skipped Not In Window","default":0},"skipped_already_sent":{"type":"integer","title":"Skipped Already Sent","default":0},"skipped_empty":{"type":"integer","title":"Skipped Empty","default":0},"failed":{"type":"integer","title":"Failed","default":0},"capped":{"type":"integer","title":"Capped","default":0},"capped_past_last_tick":{"type":"integer","title":"Capped Past Last Tick","default":0},"skipped":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skipped"}},"type":"object","title":"DigestDailyTickResponse","description":"Counters from one daily-digest cron pass. ``skipped`` is set to a\nshort reason string when the handler took no action (e.g. the\nself-lock was already held)."},"DisableTestUsersTickResponse":{"properties":{"users_matched":{"type":"integer","title":"Users Matched","default":0},"segments_stopped":{"type":"integer","title":"Segments Stopped","default":0},"projects_zeroed":{"type":"integer","title":"Projects Zeroed","default":0},"cards_detached":{"type":"integer","title":"Cards Detached","default":0},"orgs_card_cleared":{"type":"integer","title":"Orgs Card Cleared","default":0},"failed":{"type":"integer","title":"Failed","default":0},"skipped":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skipped"}},"type":"object","title":"DisableTestUsersTickResponse","description":"Counters from one disable-test-users cron pass. Stops AutoGTM projects\nand detaches saved cards for Gleb's disposable ``1fokingleb+ag…`` test\naccounts. ``skipped`` is set (``lock_held``) when a racing tick held the\nlock; everything else is 0 then."},"DmRequest":{"properties":{"sent_id":{"type":"string","title":"Sent Id"},"text":{"type":"string","maxLength":1900,"minLength":1,"title":"Text"}},"type":"object","required":["sent_id","text"],"title":"DmRequest"},"DmResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"sent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sent Id"},"provider_message_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Message Ref"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"retryable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Retryable"}},"type":"object","required":["ok"],"title":"DmResponse"},"DocItem":{"properties":{"slug":{"type":"string","title":"Slug"},"title":{"type":"string","title":"Title"},"content":{"type":"string","title":"Content"}},"type":"object","required":["slug","title","content"],"title":"DocItem"},"DomainPreviewCompany":{"properties":{"name":{"type":"string","title":"Name"},"domain":{"type":"string","title":"Domain"},"description":{"type":"string","title":"Description"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"geo_city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geo City"},"geo_country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geo Country"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"size_on_linkedin":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size On Linkedin"}},"type":"object","required":["name","domain","description"],"title":"DomainPreviewCompany"},"DomainPreviewResponse":{"properties":{"company":{"$ref":"#/components/schemas/DomainPreviewCompany"},"segments":{"items":{"$ref":"#/components/schemas/DomainPreviewSegment"},"type":"array","title":"Segments"}},"type":"object","required":["company","segments"],"title":"DomainPreviewResponse"},"DomainPreviewSegment":{"properties":{"gtm_id":{"type":"string","title":"Gtm Id"},"name":{"type":"string","title":"Name"},"pain":{"type":"string","title":"Pain"},"people_count":{"type":"integer","title":"People Count","default":0}},"type":"object","required":["gtm_id","name","pain"],"title":"DomainPreviewSegment"},"DraftGenerateRequest":{"properties":{"segment_id":{"type":"string","title":"Segment Id"},"person_profile_url":{"type":"string","title":"Person Profile Url","default":""},"company_domain":{"type":"string","title":"Company Domain","default":""},"first_name":{"type":"string","title":"First Name","default":""},"last_name":{"type":"string","title":"Last Name","default":""},"title":{"type":"string","title":"Title","default":""},"company_name":{"type":"string","title":"Company Name","default":""},"company_description":{"type":"string","title":"Company Description","default":""}},"type":"object","required":["segment_id"],"title":"DraftGenerateRequest"},"DraftPrevEmail":{"properties":{"subject":{"type":"string","title":"Subject","default":""},"body":{"type":"string","title":"Body","default":""}},"type":"object","title":"DraftPrevEmail"},"DraftPreviewRequest":{"properties":{"lead_id":{"type":"string","title":"Lead Id"},"instructions":{"type":"string","maxLength":3000,"title":"Instructions","default":""},"followup_instructions":{"type":"string","maxLength":3000,"title":"Followup Instructions","default":""},"language":{"type":"string","title":"Language","default":""},"touches":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Touches"},"prev_email":{"anyOf":[{"$ref":"#/components/schemas/DraftPrevEmail"},{"type":"null"}]}},"type":"object","required":["lead_id"],"title":"DraftPreviewRequest","description":"Body for POST /segments/{id}/preview-emails/draft.\n\nRenders a preview against UNSAVED template instructions so the user\ncan validate (preview + moderation) before persisting. Template\nfields are passed inline; the segment's persisted ``email_templates``\nis intentionally NOT consulted — this endpoint exists so the user\ncan iterate without writing to the DB until validation passes.\n\n``lead_id`` follows the same semantics as GET /preview-emails: a\nreal lead (any segment in the same project) or one of the 3 synthetic\nstandard-persona sentinel ids (``is_example_lead_id``) when the\nproject has no leads yet.\n\nResults are NOT cached. Cache writes belong to the saved-state path\n(Save → bumped version → GET fetches and caches by version)."},"ElementsCheckoutRequest":{"properties":{"device_id":{"type":"string","title":"Device Id"},"utm_source":{"type":"string","title":"Utm Source","default":""},"utm_medium":{"type":"string","title":"Utm Medium","default":""},"utm_campaign":{"type":"string","title":"Utm Campaign","default":""},"ref_code":{"type":"string","title":"Ref Code","default":""},"fbp":{"type":"string","title":"Fbp","default":""},"fbc":{"type":"string","title":"Fbc","default":""},"fbclid":{"type":"string","title":"Fbclid","default":""},"rdt_cid":{"type":"string","title":"Rdt Cid","default":""},"auto_recharge":{"type":"boolean","title":"Auto Recharge","default":false},"domain":{"type":"string","title":"Domain","default":""},"preferred_daily_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Preferred Daily Usd"}},"type":"object","required":["device_id"],"title":"ElementsCheckoutRequest"},"EmailCaptureRequest":{"properties":{"email":{"type":"string","title":"Email"},"project":{"type":"string","title":"Project"},"source":{"type":"string","title":"Source","default":"card"}},"type":"object","required":["email","project"],"title":"EmailCaptureRequest"},"EmailHighlight":{"properties":{"text":{"type":"string","title":"Text"},"kind":{"type":"string","enum":["research","ab_test","instructions","playbook"],"title":"Kind"},"title":{"type":"string","title":"Title"},"explanation":{"type":"string","title":"Explanation"},"sources":{"items":{"type":"string"},"type":"array","title":"Sources"}},"type":"object","required":["text","kind","title","explanation"],"title":"EmailHighlight","description":"A single personalization highlight returned with a generated email.\n\n`text` MUST be a verbatim substring of `GeneratedEmailPayload.body` —\nthe frontend does first-occurrence substring matching to underline the\nfragment. Entries whose `text` is not found in the body are dropped on\nthe way out; no hard validation here so malformed rows from older runs\nsimply render as plain text.\n\n`kind` drives how the UI underlines and what the hover-card says:\n\n- `research`     — grounded in RAG data (person/company/segment). The\n                   `sources` list contains RAG field names used.\n- `instructions` — adapts the email to a specific directive in the\n                   client's Instructions block. `sources[0]` contains the\n                   exact cited instruction sentence/phrase.\n- `ab_test`      — reserved for future A/B-experiment evidence. MVP does\n                   not emit this kind; old rows carrying it still render\n                   (fallback style).\n- `playbook`     — reply-composer only: the fragment's shape/move comes\n                   from our built-in reply playbook (CTA choice, brevity,\n                   no time commitment). `sources[0]` names the rule."},"EmailTemplateEntry":{"properties":{"instructions":{"type":"string","maxLength":3000,"title":"Instructions","default":""},"template":{"type":"string","title":"Template","default":""},"tone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tone"},"rag_config":{"additionalProperties":true,"type":"object","title":"Rag Config"},"own_instructions":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Own Instructions"}},"type":"object","title":"EmailTemplateEntry"},"EventBatch":{"properties":{"api_key":{"type":"string","title":"Api Key"},"events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":500,"title":"Events"},"options":{"additionalProperties":true,"type":"object","title":"Options"},"client_upload_time":{"type":"string","title":"Client Upload Time"}},"additionalProperties":true,"type":"object","required":["api_key","events","options","client_upload_time"],"title":"EventBatch"},"ExperimentCreate":{"properties":{"key":{"type":"string","title":"Key"},"slug":{"type":"string","title":"Slug"},"arms":{"items":{"$ref":"#/components/schemas/ArmSpec"},"type":"array","title":"Arms"},"owner":{"type":"string","title":"Owner"},"funnel_stage":{"type":"string","title":"Funnel Stage"},"subject_type":{"type":"string","title":"Subject Type","default":"device"},"funnel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Funnel Id"},"salt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Salt"},"event_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event From"},"event_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event To"},"hypothesis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hypothesis"},"mde_rel":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mde Rel"},"target_n_per_arm":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target N Per Arm"},"status":{"type":"string","title":"Status","default":"draft"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"task_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Task Id"},"version":{"type":"integer","title":"Version","default":1}},"type":"object","required":["key","slug","arms","owner","funnel_stage"],"title":"ExperimentCreate"},"ExperimentPatch":{"properties":{"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"},"owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"funnel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Funnel Id"},"funnel_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Funnel Stage"},"subject_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Type"},"arms":{"anyOf":[{"items":{"$ref":"#/components/schemas/ArmSpec"},"type":"array"},{"type":"null"}],"title":"Arms"},"salt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Salt"},"event_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event From"},"event_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event To"},"hypothesis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hypothesis"},"mde_rel":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mde Rel"},"target_n_per_arm":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target N Per Arm"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"task_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Task Id"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta"}},"type":"object","title":"ExperimentPatch"},"ExpiredPostpaidTickResponse":{"properties":{"scanned":{"type":"integer","title":"Scanned","default":0},"charged":{"type":"integer","title":"Charged","default":0},"settled_from_wallet":{"type":"integer","title":"Settled From Wallet","default":0},"failed":{"type":"integer","title":"Failed","default":0},"errors":{"type":"integer","title":"Errors","default":0},"skipped_locked":{"type":"integer","title":"Skipped Locked","default":0},"deferred":{"type":"integer","title":"Deferred","default":0},"skipped":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skipped"}},"type":"object","title":"ExpiredPostpaidTickResponse","description":"Counters from one expired-postpaid (month-rollover) cron pass."},"ExplorerSearchRequest":{"properties":{"query":{"type":"string","title":"Query"}},"type":"object","required":["query"],"title":"ExplorerSearchRequest"},"FollowupBatch":{"properties":{"release_id":{"type":"string","maxLength":200,"minLength":1,"title":"Release Id"},"release_url":{"type":"string","maxLength":2000,"minLength":3,"title":"Release Url"},"task_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Task Url"},"report":{"type":"string","maxLength":5000,"minLength":3,"title":"Report"},"recipients":{"items":{"$ref":"#/components/schemas/FollowupRecipient"},"type":"array","maxItems":25,"title":"Recipients"}},"type":"object","required":["release_id","release_url","report"],"title":"FollowupBatch"},"FollowupEmailCopy":{"properties":{"language":{"type":"string","maxLength":35,"minLength":2,"title":"Language"},"subject":{"type":"string","maxLength":200,"minLength":3,"title":"Subject"},"heading":{"type":"string","maxLength":200,"minLength":3,"title":"Heading"},"quote_label":{"type":"string","maxLength":200,"minLength":2,"title":"Quote Label"},"change_label":{"type":"string","maxLength":200,"minLength":2,"title":"Change Label"},"release_summary":{"type":"string","maxLength":500,"minLength":3,"title":"Release Summary"},"live_line":{"type":"string","maxLength":200,"minLength":2,"title":"Live Line"},"thanks_line":{"type":"string","maxLength":500,"minLength":3,"title":"Thanks Line"},"cta_label":{"type":"string","maxLength":100,"minLength":2,"title":"Cta Label"}},"type":"object","required":["language","subject","heading","quote_label","change_label","release_summary","live_line","thanks_line","cta_label"],"title":"FollowupEmailCopy","description":"Already reviewed, recipient-language copy rendered without raw HTML."},"FollowupRecipient":{"properties":{"email":{"type":"string","maxLength":320,"title":"Email"},"complaint_quote":{"type":"string","maxLength":500,"minLength":3,"title":"Complaint Quote"},"copy":{"$ref":"#/components/schemas/FollowupEmailCopy"},"source_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Source Url"},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At"}},"type":"object","required":["email","complaint_quote"],"title":"FollowupRecipient"},"FounderMailFlowDispatchResponse":{"properties":{"deployment":{"type":"string","title":"Deployment"},"flow_run_id":{"type":"string","title":"Flow Run Id"}},"type":"object","required":["deployment","flow_run_id"],"title":"FounderMailFlowDispatchResponse","description":"A founder-mail family endpoint dispatched its Prefect flow run (T-1530):\nthe tick's work and counters live in the flow run, not in this response."},"FounderNudgesTickResponse":{"properties":{"scanned":{"type":"integer","title":"Scanned","default":0},"founder_ask_sent":{"type":"integer","title":"Founder Ask Sent","default":0},"paused_nudge_sent":{"type":"integer","title":"Paused Nudge Sent","default":0},"failed":{"type":"integer","title":"Failed","default":0},"skipped":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skipped"}},"type":"object","title":"FounderNudgesTickResponse","description":"Counters from one founder-nudges cron pass (founder-ask + paused-nudge).\n``skipped`` is a short reason when the handler took no action (e.g. self-\nlock held)."},"GeneratedEmailPayload":{"properties":{"id":{"type":"string","title":"Id"},"segment_id":{"type":"integer","title":"Segment Id"},"lead_id":{"type":"string","title":"Lead Id"},"touch_number":{"type":"integer","title":"Touch Number"},"email_templates_version":{"type":"integer","title":"Email Templates Version"},"subject":{"type":"string","title":"Subject"},"body":{"type":"string","title":"Body"},"lead_first_name":{"type":"string","title":"Lead First Name","default":""},"lead_last_name":{"type":"string","title":"Lead Last Name","default":""},"lead_company_name":{"type":"string","title":"Lead Company Name","default":""},"language_used":{"type":"string","title":"Language Used","default":""},"language_reason":{"type":"string","title":"Language Reason","default":""},"highlights":{"items":{"$ref":"#/components/schemas/EmailHighlight"},"type":"array","title":"Highlights"},"cache_hit":{"type":"boolean","title":"Cache Hit","default":false}},"type":"object","required":["id","segment_id","lead_id","touch_number","email_templates_version","subject","body"],"title":"GeneratedEmailPayload","description":"Canonical wire shape for a generated email.\n\nPreview UI and the email-sending service consume the exact same payload\n— both come out of `get_or_generate_email`. Mirrors `GeneratedEmail` DB\ncolumns minus the internal `snapshot` JSONB (debug-only, not shipped).\n\n`lead_*` fields are an optional convenience snippet for UI labels. Empty\nstrings for callers that don't carry the lead in hand (the sender looks\nup recipient details via its own mailbox/contact flow).\n\n`language_used` + `highlights` are JSONB-backed (read from `snapshot`),\nso no DB migration is required — rows written before this change simply\ndefault to `''` / `[]`."},"GeoDistItem":{"properties":{"country":{"type":"string","title":"Country"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["country","count"],"title":"GeoDistItem"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HistoryResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SearchHistoryItem"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"HistoryResponse"},"HostedCheckoutRequest":{"properties":{"device_id":{"type":"string","title":"Device Id"},"success_url":{"type":"string","title":"Success Url"},"cancel_url":{"type":"string","title":"Cancel Url"},"utm_source":{"type":"string","title":"Utm Source","default":""},"utm_medium":{"type":"string","title":"Utm Medium","default":""},"utm_campaign":{"type":"string","title":"Utm Campaign","default":""},"ref_code":{"type":"string","title":"Ref Code","default":""},"fbp":{"type":"string","title":"Fbp","default":""},"fbc":{"type":"string","title":"Fbc","default":""},"fbclid":{"type":"string","title":"Fbclid","default":""},"rdt_cid":{"type":"string","title":"Rdt Cid","default":""},"auto_recharge":{"type":"boolean","title":"Auto Recharge","default":false},"domain":{"type":"string","title":"Domain","default":""}},"type":"object","required":["device_id","success_url","cancel_url"],"title":"HostedCheckoutRequest"},"HubspotIntegrationState":{"properties":{"provider":{"type":"string","title":"Provider","default":"hubspot"},"available":{"type":"boolean","title":"Available"},"connected":{"type":"boolean","title":"Connected"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"push_enabled":{"type":"boolean","title":"Push Enabled","default":true},"pipeline_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pipeline Id"},"dealstage_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealstage Id"},"pipeline_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pipeline Label"},"dealstage_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealstage Label"},"last_push_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Push At"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"pushed_count":{"type":"integer","title":"Pushed Count","default":0}},"type":"object","required":["available","connected"],"title":"HubspotIntegrationState"},"InboxContactOut":{"properties":{"profile_url":{"type":"string","title":"Profile Url"},"person_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"account_ref":{"type":"string","title":"Account Ref"},"connection_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connection State"},"last_outbound_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Outbound At"},"last_inbound_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Inbound At"},"inbound_count":{"type":"integer","title":"Inbound Count"},"last_inbound_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Inbound Preview"},"needs_reply":{"type":"boolean","title":"Needs Reply"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"},"lead_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Name"}},"type":"object","required":["profile_url","person_id","project_id","account_ref","connection_state","last_outbound_at","last_inbound_at","inbound_count","last_inbound_preview","needs_reply"],"title":"InboxContactOut"},"InboxContactsResponse":{"properties":{"contacts":{"items":{"$ref":"#/components/schemas/InboxContactOut"},"type":"array","title":"Contacts"}},"type":"object","required":["contacts"],"title":"InboxContactsResponse"},"InboxCountsResponse":{"properties":{"project_id":{"type":"integer","title":"Project Id"},"campaign_filter":{"type":"string","title":"Campaign Filter"},"need_reply":{"type":"integer","title":"Need Reply"},"replied":{"type":"integer","title":"Replied"},"sent":{"type":"integer","title":"Sent"},"available_filters":{"items":{"$ref":"#/components/schemas/AvailableFilter"},"type":"array","title":"Available Filters"},"ooo_season":{"anyOf":[{"$ref":"#/components/schemas/OooSeasonInfo"},{"type":"null"}]}},"type":"object","required":["project_id","campaign_filter","need_reply","replied","sent","available_filters"],"title":"InboxCountsResponse"},"InboxSendRequest":{"properties":{"profile_url":{"type":"string","title":"Profile Url"},"text":{"type":"string","maxLength":1900,"minLength":1,"title":"Text"}},"type":"object","required":["profile_url","text"],"title":"InboxSendRequest"},"InboxSendResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"sent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sent Id"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"retryable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Retryable"}},"type":"object","required":["ok"],"title":"InboxSendResponse"},"InboxSyncResponse":{"properties":{"accepted_count":{"type":"integer","title":"Accepted Count"},"new_inbound":{"type":"integer","title":"New Inbound"}},"type":"object","required":["accepted_count","new_inbound"],"title":"InboxSyncResponse"},"InboxThreadResponse":{"properties":{"contact":{"anyOf":[{"$ref":"#/components/schemas/InboxContactOut"},{"type":"null"}]},"messages":{"items":{"$ref":"#/components/schemas/ThreadMessageOut"},"type":"array","title":"Messages"}},"type":"object","required":["contact","messages"],"title":"InboxThreadResponse"},"IntegrationsResponse":{"properties":{"project_id":{"type":"integer","title":"Project Id"},"hubspot":{"$ref":"#/components/schemas/HubspotIntegrationState"}},"type":"object","required":["project_id","hubspot"],"title":"IntegrationsResponse"},"IntentFeedbackRequest":{"properties":{"label":{"type":"string","enum":["hot_lead","not_relevant"],"title":"Label"}},"type":"object","required":["label"],"title":"IntentFeedbackRequest"},"InterestedLeadsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/LastReplyItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"InterestedLeadsResponse"},"InterruptInput":{"properties":{"kind":{"type":"string","const":"interrupt","title":"Kind","default":"interrupt"}},"type":"object","title":"InterruptInput"},"InviteResultRow":{"properties":{"profile_url":{"type":"string","title":"Profile Url"},"ok":{"type":"boolean","title":"Ok"},"sent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sent Id"},"connection_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connection State"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"retryable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Retryable"}},"type":"object","required":["profile_url","ok"],"title":"InviteResultRow"},"InvitesRequest":{"properties":{"account_ref":{"type":"string","title":"Account Ref"},"note":{"type":"string","maxLength":280,"minLength":1,"title":"Note"},"profile_urls":{"items":{"type":"string"},"type":"array","maxItems":20,"minItems":1,"title":"Profile Urls"},"project_id":{"type":"string","title":"Project Id","default":"linkedin-poc-manual"}},"type":"object","required":["account_ref","note","profile_urls"],"title":"InvitesRequest"},"InvitesResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/InviteResultRow"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"InvitesResponse"},"JobTitleDistItem":{"properties":{"title":{"type":"string","title":"Title"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["title","count"],"title":"JobTitleDistItem"},"LastReplyItem":{"properties":{"person_id":{"type":"string","title":"Person Id"},"segment_id":{"type":"integer","title":"Segment Id"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"company_display":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Display"},"received_at":{"type":"string","title":"Received At"},"intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intent"},"snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snippet"},"person_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person Name"},"campaign_name":{"type":"string","title":"Campaign Name","default":""},"reply_status":{"type":"string","enum":["not_replied","replied","agent_replied","auto_handled"],"title":"Reply Status","default":"not_replied"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"need_reply":{"type":"boolean","title":"Need Reply","default":false},"lead_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Status"}},"type":"object","required":["person_id","segment_id","company_name","received_at","intent","snippet"],"title":"LastReplyItem","description":"Teaser row for the last-replies table (``LAST_REPLIES_LIMIT`` items)."},"LaunchSegmentRequest":{"properties":{"daily_limit_usd":{"type":"integer","maximum":300.0,"minimum":1.0,"title":"Daily Limit Usd"},"target_url":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Target Url"}},"type":"object","required":["daily_limit_usd"],"title":"LaunchSegmentRequest"},"LaunchSegmentResponse":{"properties":{"segment_id":{"type":"integer","title":"Segment Id"}},"type":"object","required":["segment_id"],"title":"LaunchSegmentResponse"},"LaunchUpdateTickResponse":{"properties":{"scanned":{"type":"integer","title":"Scanned","default":0},"sent":{"type":"integer","title":"Sent","default":0},"skipped_already_sent":{"type":"integer","title":"Skipped Already Sent","default":0},"skipped_no_recipient":{"type":"integer","title":"Skipped No Recipient","default":0},"skipped_budget_zero":{"type":"integer","title":"Skipped Budget Zero","default":0},"failed":{"type":"integer","title":"Failed","default":0},"skipped":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skipped"}},"type":"object","title":"LaunchUpdateTickResponse","description":"Counters from one +90-min launch-update cron pass. ``skipped`` is a\nshort reason when the handler took no action (e.g. self-lock held)."},"LeadFinderEnrolBody":{"properties":{"segment_ids":{"items":{"type":"integer"},"type":"array","title":"Segment Ids"},"arm":{"type":"string","title":"Arm"}},"type":"object","required":["segment_ids","arm"],"title":"LeadFinderEnrolBody"},"LeadFinderExcludeBody":{"properties":{"segment_ids":{"items":{"type":"integer"},"type":"array","title":"Segment Ids"},"drop":{"type":"boolean","title":"Drop","default":false}},"type":"object","required":["segment_ids"],"title":"LeadFinderExcludeBody"},"LeadStatusVocab":{"properties":{"statuses":{"items":{"$ref":"#/components/schemas/LeadStatusVocabItem"},"type":"array","title":"Statuses"}},"type":"object","required":["statuses"],"title":"LeadStatusVocab"},"LeadStatusVocabItem":{"properties":{"name":{"type":"string","title":"Name"},"color":{"type":"string","title":"Color"},"order":{"type":"integer","title":"Order"}},"type":"object","required":["name","color","order"],"title":"LeadStatusVocabItem"},"LeadsBreakdown":{"properties":{"geo_people":{"items":{"$ref":"#/components/schemas/GeoDistItem"},"type":"array","title":"Geo People"},"geo_companies":{"items":{"$ref":"#/components/schemas/GeoDistItem"},"type":"array","title":"Geo Companies"},"job_titles":{"items":{"$ref":"#/components/schemas/JobTitleDistItem"},"type":"array","title":"Job Titles"},"sizes":{"items":{"$ref":"#/components/schemas/SizeDistItem"},"type":"array","title":"Sizes"}},"type":"object","required":["geo_people","geo_companies","job_titles","sizes"],"title":"LeadsBreakdown"},"LeadsExportPayload":{"properties":{"export_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Export Name"},"leads_requested":{"type":"integer","title":"Leads Requested"},"leads_per_company":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Leads Per Company"},"query":{"type":"string","title":"Query"},"companies_filters":{"$ref":"#/components/schemas/CompaniesSearchFilters"},"people_filters":{"$ref":"#/components/schemas/PeopleSearchFilters"},"deduplication":{"anyOf":[{"$ref":"#/components/schemas/DeduplicationSettings"},{"type":"null"}]},"linkedin_preset":{"anyOf":[{"type":"string","const":"basic"},{"type":"null"}],"title":"Linkedin Preset"},"emails_preset":{"anyOf":[{"type":"string","enum":["basic","premium"]},{"type":"null"}],"title":"Emails Preset"},"phones_preset":{"anyOf":[{"type":"string","enum":["basic","basic_new","premium"]},{"type":"null"}],"title":"Phones Preset"}},"type":"object","required":["leads_requested","query","companies_filters","people_filters"],"title":"LeadsExportPayload"},"LeadsMeta":{"properties":{"companies_count":{"type":"integer","title":"Companies Count"},"people_count":{"type":"integer","title":"People Count"},"companies_shown":{"type":"integer","title":"Companies Shown","default":0},"people_shown":{"type":"integer","title":"People Shown","default":0}},"type":"object","required":["companies_count","people_count"],"title":"LeadsMeta"},"ListAgentsResponse":{"properties":{"agents":{"items":{"$ref":"#/components/schemas/AgentInfo"},"type":"array","title":"Agents"}},"type":"object","required":["agents"],"title":"ListAgentsResponse"},"ListTasksResponse":{"properties":{"tasks":{"items":{"$ref":"#/components/schemas/TaskSummary"},"type":"array","title":"Tasks"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["tasks","total"],"title":"ListTasksResponse"},"LookalikeSearchRequest":{"properties":{"domain":{"type":"string","title":"Domain"}},"type":"object","required":["domain"],"title":"LookalikeSearchRequest"},"LookalikeTaskResponse":{"properties":{"attempt_id":{"type":"string","title":"Attempt Id"}},"type":"object","required":["attempt_id"],"title":"LookalikeTaskResponse"},"MaterialPatchRequest":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"MaterialPatchRequest"},"MessageInput":{"properties":{"kind":{"type":"string","const":"message","title":"Kind","default":"message"},"text":{"type":"string","maxLength":10000,"minLength":1,"title":"Text"},"client_msg_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Msg Id"},"automated":{"type":"boolean","title":"Automated","default":false}},"type":"object","required":["text"],"title":"MessageInput"},"ModeratePreviewRequest":{"properties":{"subject":{"type":"string","title":"Subject"},"body_text":{"type":"string","title":"Body Text"}},"type":"object","required":["subject","body_text"],"title":"ModeratePreviewRequest","description":"Body for POST /segments/{id}/moderate-preview.\n\nFrontend ships the rendered preview content (the ``subject`` /\n``body_text`` it just got back from /preview-emails) so the backend can\nmoderate it without re-generating. Decoupling moderation from\ngeneration lets the email body render fast on the editor while the\nmoderation indicator runs separately and can show its own delayed\n'Checking content…' affordance."},"ModeratePreviewResponse":{"properties":{"moderation_status":{"type":"string","enum":["ok","blocked"],"title":"Moderation Status","default":"ok"},"moderation_category":{"type":"string","title":"Moderation Category","default":""}},"type":"object","title":"ModeratePreviewResponse","description":"Send-side moderation verdict for the supplied subject + body.\n\nMirrors what `api.outreach.moderation.moderate_email` returns. ``llm:``\nprefix is stripped so the wire format matches the deterministic-stage\ntokens — the frontend's ``moderationCopy`` table keys on the bare\nform. Empty ``moderation_category`` means it passed."},"NotificationPreferences":{"properties":{"daily_digest":{"type":"boolean","title":"Daily Digest"},"autopilot_recap":{"type":"boolean","title":"Autopilot Recap"}},"type":"object","required":["daily_digest","autopilot_recap"],"title":"NotificationPreferences"},"NotificationPreferencesUpdate":{"properties":{"daily_digest":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Daily Digest"},"autopilot_recap":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Autopilot Recap"}},"type":"object","title":"NotificationPreferencesUpdate","description":"Partial update — only the provided fields are written."},"OooSeasonInfo":{"properties":{"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"}},"type":"object","title":"OooSeasonInfo","description":"OOO vacation-season reassurance strip (T-1124).\n\nPresent only when the strip should show: the project got more than\n``OOO_THRESHOLD`` out-of-office replies in the last ``OOO_WINDOW_DAYS``\ndays AND it's vacation season in (the majority of) its target\ncountries. ``country`` names the single in-season target country for\nthe copy; ``None`` when several are in season at once."},"OrgSpentTodayResponse":{"properties":{"spent_today_usd":{"type":"number","title":"Spent Today Usd"},"daily_limit_usd":{"type":"integer","title":"Daily Limit Usd"}},"type":"object","required":["spent_today_usd","daily_limit_usd"],"title":"OrgSpentTodayResponse","description":"Org-wide \"spent today\" snapshot for the global Billing tab.\n\n`daily_limit_usd` sums per-segment caps over segments currently in the\n`outreach` phase — that's the realistic ceiling we could hit today.\nBoth fields are 0 when no outreach segments exist (UI shows an empty bar)."},"OrgWithProjects":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"OrgWithProjects"},"OrgsWithProjectsResponse":{"properties":{"orgs":{"items":{"$ref":"#/components/schemas/OrgWithProjects"},"type":"array","title":"Orgs","default":[]}},"type":"object","title":"OrgsWithProjectsResponse","description":"The current user's *other* orgs (not the active one) that hold a real\nAutoGTM project, so the app shell can offer a multi-org user a one-click\nswitch out of an empty org into the one with their work (T-341). Ordered\nnewest-project first. Empty list when no other org qualifies — the current\norg's empty-state then stands."},"OutreachSendRequest":{"properties":{"person_id":{"type":"string","title":"Person Id"},"body_text":{"type":"string","title":"Body Text"},"cc_emails":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Cc Emails"},"material_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Material Ids"}},"type":"object","required":["person_id","body_text"],"title":"OutreachSendRequest"},"PatchDatasetRequest":{"properties":{"headers":{"items":{"type":"string"},"type":"array","title":"Headers"},"rows":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Rows"}},"type":"object","required":["headers","rows"],"title":"PatchDatasetRequest"},"PatchHubspotRequest":{"properties":{"push_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Push Enabled"},"pipeline_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pipeline Id"},"dealstage_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealstage Id"},"pipeline_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pipeline Label"},"dealstage_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dealstage Label"}},"type":"object","title":"PatchHubspotRequest"},"PeopleEstimateStatsPayload":{"properties":{"companies_filters":{"additionalProperties":true,"type":"object","title":"Companies Filters"},"people_filters":{"additionalProperties":true,"type":"object","title":"People Filters"},"clusterization":{"type":"boolean","title":"Clusterization","default":false}},"type":"object","required":["companies_filters","people_filters"],"title":"PeopleEstimateStatsPayload"},"PeopleSearchFilters":{"properties":{"job_titles":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Job Titles"},"min_relevance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Relevance"},"job_titles_exclude":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Titles Exclude"},"job_titles_ids_include":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Job Titles Ids Include"},"geo":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Geo"},"followers":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Followers"},"people_per_company_limit":{"type":"integer","title":"People Per Company Limit","default":2},"companies_match_level":{"anyOf":[{"type":"string","enum":["strong","strong+weak","all"]},{"type":"null"}],"title":"Companies Match Level"},"people_match_level":{"anyOf":[{"type":"string","enum":["strong","strong+weak","all"]},{"type":"null"}],"title":"People Match Level"},"criteria":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Criteria"}},"type":"object","title":"PeopleSearchFilters"},"PeopleSearchPayload":{"properties":{"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"},"companies_filters":{"additionalProperties":true,"type":"object","title":"Companies Filters"},"people_filters":{"additionalProperties":true,"type":"object","title":"People Filters"},"clusterization":{"type":"boolean","title":"Clusterization","default":false},"page":{"type":"integer","title":"Page","default":1},"order_by":{"type":"string","enum":["relevance","match"],"title":"Order By","default":"relevance"},"deduplication":{"anyOf":[{"$ref":"#/components/schemas/DeduplicationSettings"},{"type":"null"}]},"extra_columns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extra Columns"}},"type":"object","required":["companies_filters","people_filters"],"title":"PeopleSearchPayload"},"PerformancePoint":{"properties":{"bucket_start":{"type":"string","format":"date","title":"Bucket Start"},"bucket_end":{"type":"string","format":"date","title":"Bucket End"},"label":{"type":"string","title":"Label"},"emails_sent":{"type":"integer","title":"Emails Sent"},"reply_rate_pct":{"type":"number","title":"Reply Rate Pct"},"hot_leads":{"type":"integer","title":"Hot Leads"},"spend_usd":{"type":"number","title":"Spend Usd"},"bounced":{"type":"integer","title":"Bounced"}},"type":"object","required":["bucket_start","bucket_end","label","emails_sent","reply_rate_pct","hot_leads","spend_usd","bounced"],"title":"PerformancePoint","description":"One bucket on a Performance-tile sparkline. Bucket width varies with\nperiod (see ``_build_performance_buckets``): daily for today/7d, weekly\nfor 30d, monthly for all. Pre-formatted ``label`` is what the chart's\nX-axis renders ('Mon' / 'W21' / 'May'); the inclusive\n``bucket_start``..``bucket_end`` pair lets the tooltip format the\nunderlying date or range without re-deriving it from ``label``."},"Pipeline":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"stages":{"items":{"$ref":"#/components/schemas/PipelineStage"},"type":"array","title":"Stages"}},"type":"object","required":["id","label","stages"],"title":"Pipeline"},"PipelineStage":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"}},"type":"object","required":["id","label"],"title":"PipelineStage"},"PipelinesResponse":{"properties":{"pipelines":{"items":{"$ref":"#/components/schemas/Pipeline"},"type":"array","title":"Pipelines"}},"type":"object","required":["pipelines"],"title":"PipelinesResponse"},"PlaqueSegment":{"properties":{"segment_id":{"type":"integer","title":"Segment Id"},"name":{"type":"string","title":"Name","default":""},"daily_limit_usd":{"type":"number","title":"Daily Limit Usd","default":0.0}},"type":"object","required":["segment_id"],"title":"PlaqueSegment","description":"One campaign a plaque button acts on.\n\n``daily_limit_usd`` is only meaningful for `retry_launch` (the relaunch\ncall needs it, same as `CtaRetryLaunchSegment`); every other state leaves\nit at its default."},"PrevKpis":{"properties":{"emails_sent":{"type":"integer","title":"Emails Sent"},"first_touch_sent":{"type":"integer","title":"First Touch Sent"},"replies":{"type":"integer","title":"Replies"},"reply_rate_pct":{"type":"number","title":"Reply Rate Pct"},"hot_leads":{"type":"integer","title":"Hot Leads"},"spend_usd":{"type":"number","title":"Spend Usd"},"start":{"type":"string","format":"date","title":"Start"},"end":{"type":"string","format":"date","title":"End"}},"type":"object","required":["emails_sent","first_touch_sent","replies","reply_rate_pct","hot_leads","spend_usd","start","end"],"title":"PrevKpis","description":"T-2749 — KPI totals for the previous comparison window (same length,\nimmediately before the selected period). None on 'all'. Scoped exactly\nlike the headline KPIs (same campaign filter, archived excluded)."},"PreviewLead":{"properties":{"id":{"type":"string","title":"Id"},"first_name":{"type":"string","title":"First Name"},"last_name":{"type":"string","title":"Last Name"},"company":{"type":"string","title":"Company"},"lead_country_iso_2":{"type":"string","title":"Lead Country Iso 2","default":""},"company_geo_country":{"type":"string","title":"Company Geo Country","default":""},"lead_headline":{"type":"string","title":"Lead Headline","default":""},"profile_photo_url":{"type":"string","title":"Profile Photo Url","default":""},"company_logo_url":{"type":"string","title":"Company Logo Url","default":""},"company_domain":{"type":"string","title":"Company Domain","default":""}},"type":"object","required":["id","first_name","last_name","company"],"title":"PreviewLead","description":"Minimal lead record for the `Preview as` dropdown on the outreach tab.\n\nOrdered the same way the backend's `preview_emails` endpoint selects\ndefault leads (`created_at ASC, id ASC`), so `preview_leads[0]` is the\nlead that generation would pick first — matching what the UI shows."},"PricingResponse":{"properties":{"email_price_credits":{"type":"number","title":"Email Price Credits"},"credit_usd_cents":{"type":"integer","title":"Credit Usd Cents"},"email_price_usd":{"type":"number","title":"Email Price Usd"},"projections":{"anyOf":[{"$ref":"#/components/schemas/ProjectionsConfig"},{"type":"null"}]},"included_features":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Included Features"}},"type":"object","required":["email_price_credits","credit_usd_cents","email_price_usd"],"title":"PricingResponse"},"ProjectBudgetResponse":{"properties":{"project_id":{"type":"integer","title":"Project Id"},"daily_budget_usd":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Daily Budget Usd"}},"type":"object","required":["project_id"],"title":"ProjectBudgetResponse","description":"The project's daily-budget anchor — the single number the dashboard bar\nshows and the slider sets. Per-campaign allocations are machine-managed and\ndeliberately not surfaced; the old heavy per-campaign budget/spend/stats read\nwas dropped (it only fed a now-removed page + a tiny \"spent today\" caption)."},"ProjectContextResponse":{"properties":{"project":{"$ref":"#/components/schemas/ProjectInfo"},"segments":{"items":{"$ref":"#/components/schemas/SegmentInfo"},"type":"array","title":"Segments"}},"type":"object","required":["project","segments"],"title":"ProjectContextResponse"},"ProjectDashboardResponse":{"properties":{"project_id":{"type":"integer","title":"Project Id"},"period":{"type":"string","enum":["today","7d","30d","all"],"title":"Period"},"total_emails_sent":{"type":"integer","title":"Total Emails Sent"},"total_first_touch_sent":{"type":"integer","title":"Total First Touch Sent"},"total_replies":{"type":"integer","title":"Total Replies"},"total_auto_replies":{"type":"integer","title":"Total Auto Replies"},"total_bounced":{"type":"integer","title":"Total Bounced"},"overall_reply_rate_pct":{"type":"number","title":"Overall Reply Rate Pct"},"total_hot_leads":{"type":"integer","title":"Total Hot Leads"},"total_hot_leads_today":{"type":"integer","title":"Total Hot Leads Today"},"total_spend_usd":{"type":"number","title":"Total Spend Usd"},"campaign_rollup":{"items":{"$ref":"#/components/schemas/CampaignRollupItem"},"type":"array","title":"Campaign Rollup"},"lead_status_vocab":{"items":{"$ref":"#/components/schemas/LeadStatusVocabItem"},"type":"array","title":"Lead Status Vocab"},"daily_breakdown":{"items":{"$ref":"#/components/schemas/DailyBreakdownItem"},"type":"array","title":"Daily Breakdown"},"performance_series":{"items":{"$ref":"#/components/schemas/PerformancePoint"},"type":"array","title":"Performance Series"},"last_replies":{"items":{"$ref":"#/components/schemas/LastReplyItem"},"type":"array","title":"Last Replies"},"prev":{"anyOf":[{"$ref":"#/components/schemas/PrevKpis"},{"type":"null"}]},"cta":{"anyOf":[{"$ref":"#/components/schemas/CtaSetupStep"},{"$ref":"#/components/schemas/CtaAutopilot"},{"$ref":"#/components/schemas/CtaInbox"},{"$ref":"#/components/schemas/CtaBilling"},{"$ref":"#/components/schemas/CtaAutoReply"},{"$ref":"#/components/schemas/CtaReferral"},{"$ref":"#/components/schemas/CtaZeroBudget"},{"$ref":"#/components/schemas/CtaNoCard"},{"type":"null"}],"title":"Cta"},"day_off_until":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Day Off Until"},"status_line":{"$ref":"#/components/schemas/StatusLineResponse"},"balance":{"anyOf":[{"$ref":"#/components/schemas/BalanceTile"},{"type":"null"}]},"setup_steps":{"items":{"$ref":"#/components/schemas/SetupStepResponse"},"type":"array","title":"Setup Steps"}},"type":"object","required":["project_id","period","total_emails_sent","total_first_touch_sent","total_replies","total_auto_replies","total_bounced","overall_reply_rate_pct","total_hot_leads","total_hot_leads_today","total_spend_usd","campaign_rollup","lead_status_vocab","daily_breakdown","performance_series","last_replies","status_line","setup_steps"],"title":"ProjectDashboardResponse"},"ProjectDetails":{"properties":{"id":{"type":"integer","title":"Id"},"domain":{"type":"string","title":"Domain"},"description":{"type":"string","title":"Description"},"competitors":{"items":{"type":"string"},"type":"array","title":"Competitors"},"info":{"additionalProperties":true,"type":"object","title":"Info"},"auto_reply_enabled":{"type":"boolean","title":"Auto Reply Enabled","default":true},"auto_reply_delay_minutes":{"type":"integer","title":"Auto Reply Delay Minutes","default":1440},"autopilot_enabled":{"type":"boolean","title":"Autopilot Enabled","default":true},"reply_cc_emails":{"items":{"type":"string"},"type":"array","title":"Reply Cc Emails"},"target_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Url"},"reply_instructions":{"type":"string","title":"Reply Instructions","default":""}},"type":"object","required":["id","domain","description","competitors","info","reply_cc_emails"],"title":"ProjectDetails","description":"Response of PATCH /projects/{id} — full project surface the forms need.\n\n`info` is returned as-is so the Profile sub-form can render the read-only\nbadges (industry, team_size, location, founded, …) without an extra round\ntrip. `competitors` is always normalised to a plain domain list on the way\nout (`docs_builder.competitor_domains`), so whatever the frontend renders\nre-validates on the next PATCH — display names would 422 the domain\nvalidator."},"ProjectDocCreateRequest":{"properties":{"doc_type":{"type":"string","title":"Doc Type","default":"other"},"title":{"type":"string","maxLength":120,"title":"Title","default":""},"content":{"type":"string","maxLength":20000,"minLength":1,"title":"Content"}},"type":"object","required":["content"],"title":"ProjectDocCreateRequest"},"ProjectDocItem":{"properties":{"id":{"type":"string","title":"Id"},"doc_type":{"type":"string","title":"Doc Type"},"title":{"type":"string","title":"Title"},"content":{"type":"string","title":"Content"},"source":{"type":"string","enum":["user","ai"],"title":"Source"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"extracted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Extracted At"},"extracted_from_replies":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Extracted From Replies"}},"type":"object","required":["id","doc_type","title","content","source","updated_at"],"title":"ProjectDocItem","description":"One project doc as returned to the Project docs UI."},"ProjectDocTypeOption":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"core":{"type":"boolean","title":"Core","default":false}},"type":"object","required":["key","label"],"title":"ProjectDocTypeOption","description":"A selectable doc type + its display label, for the UI picker."},"ProjectDocUpdateRequest":{"properties":{"doc_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Type"},"title":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Title"},"content":{"anyOf":[{"type":"string","maxLength":20000,"minLength":1},{"type":"null"}],"title":"Content"}},"type":"object","title":"ProjectDocUpdateRequest"},"ProjectDocsResponse":{"properties":{"docs":{"items":{"$ref":"#/components/schemas/ProjectDocItem"},"type":"array","title":"Docs","default":[]},"types":{"items":{"$ref":"#/components/schemas/ProjectDocTypeOption"},"type":"array","title":"Types","default":[]},"gt_replies":{"type":"integer","title":"Gt Replies","default":0},"gt_replies_threshold":{"type":"integer","title":"Gt Replies Threshold","default":5}},"type":"object","title":"ProjectDocsResponse"},"ProjectInfo":{"properties":{"id":{"type":"integer","title":"Id"},"domain":{"type":"string","title":"Domain"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"competitors":{"items":{"type":"string"},"type":"array","title":"Competitors"},"info":{"additionalProperties":true,"type":"object","title":"Info"},"auto_reply_enabled":{"type":"boolean","title":"Auto Reply Enabled","default":true},"auto_reply_delay_minutes":{"type":"integer","title":"Auto Reply Delay Minutes","default":1440},"autopilot_enabled":{"type":"boolean","title":"Autopilot Enabled","default":true},"reply_cc_emails":{"items":{"type":"string"},"type":"array","title":"Reply Cc Emails"},"reply_instructions":{"type":"string","title":"Reply Instructions","default":""},"owner_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Email"},"target_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Url"}},"type":"object","required":["id","domain","reply_cc_emails"],"title":"ProjectInfo"},"ProjectSummary":{"properties":{"id":{"type":"integer","title":"Id"},"domain":{"type":"string","title":"Domain"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"segments":{"items":{"$ref":"#/components/schemas/SegmentSummary"},"type":"array","title":"Segments","default":[]}},"type":"object","required":["id","domain"],"title":"ProjectSummary"},"ProjectUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Description"},"competitors":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50},{"type":"null"}],"title":"Competitors"},"company_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Company Name"},"auto_reply_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Reply Enabled"},"reply_cc_emails":{"anyOf":[{"items":{"type":"string","format":"email"},"type":"array","maxItems":20},{"type":"null"}],"title":"Reply Cc Emails"},"auto_reply_delay_minutes":{"anyOf":[{"type":"integer","maximum":1440.0,"minimum":0.0},{"type":"null"}],"title":"Auto Reply Delay Minutes"},"autopilot_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Autopilot Enabled"},"target_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Target Url"},"reply_instructions":{"anyOf":[{"type":"string","maxLength":3000},{"type":"null"}],"title":"Reply Instructions"}},"type":"object","title":"ProjectUpdateRequest","description":"PATCH /projects/{id} body. All fields optional — client sends only what\nthe Save button touched (one sub-form at a time)."},"ProjectionsConfig":{"properties":{"daily_min_usd":{"type":"integer","title":"Daily Min Usd"},"daily_max_usd":{"type":"integer","title":"Daily Max Usd"},"default_daily_usd":{"type":"integer","title":"Default Daily Usd"},"sending_days_per_month":{"type":"integer","title":"Sending Days Per Month"},"reply_rate":{"$ref":"#/components/schemas/ReplyOrMeetingRate"},"meeting_rate":{"$ref":"#/components/schemas/ReplyOrMeetingRate"},"tiers":{"items":{"$ref":"#/components/schemas/BudgetTierItem"},"type":"array","title":"Tiers"}},"type":"object","required":["daily_min_usd","daily_max_usd","default_daily_usd","sending_days_per_month","reply_rate","meeting_rate","tiers"],"title":"ProjectionsConfig","description":"Forecast knobs shared by the dashboard budget-slider and the offer paywall."},"ReactivationClassifyRequest":{"properties":{"org_id":{"type":"string","title":"Org Id"}},"type":"object","required":["org_id"],"title":"ReactivationClassifyRequest","description":"Churn-cause classification for the winback letter (T-1090): dossier +\nstop-feedback → one of the 5 copy segments + a RU rationale."},"ReactivationClassifyResponse":{"properties":{"segment":{"type":"string","title":"Segment"},"confidence":{"type":"string","title":"Confidence"},"rationale":{"type":"string","title":"Rationale"},"feedback_used":{"type":"boolean","title":"Feedback Used","default":false}},"type":"object","required":["segment","confidence","rationale"],"title":"ReactivationClassifyResponse"},"ReactivationDraftRequest":{"properties":{"org_id":{"type":"string","title":"Org Id"},"segment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Segment"}},"type":"object","required":["org_id"],"title":"ReactivationDraftRequest","description":"One reactivation letter draft for one confirmed-dead org (T-1068 stage 1).\nCalled by reactivation.d's org card («сгенерировать драфт»). ``segment``\n(T-1090) shapes the first-touch angle — usually the classifier verdict."},"ReactivationDraftResponse":{"properties":{"subject":{"type":"string","title":"Subject"},"body":{"type":"string","title":"Body"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","default":[]},"feedback_used":{"type":"boolean","title":"Feedback Used","default":false},"is_reply":{"type":"boolean","title":"Is Reply","default":false},"segment_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Segment Used"}},"type":"object","required":["subject","body"],"title":"ReactivationDraftResponse"},"ReactivationSendTestRequest":{"properties":{"org_id":{"type":"string","title":"Org Id"},"subject":{"type":"string","title":"Subject"},"body":{"type":"string","title":"Body"},"campaign_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Context"},"trigger":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger"}},"type":"object","required":["org_id","subject","body"],"title":"ReactivationSendTestRequest","description":"Send the (possibly edited) draft to the org's own owner on the real\nfounder-mail rails — stage 1 refuses any org whose owner is not an\nemployee address (a team member's test org)."},"ReactivationSendTestResponse":{"properties":{"thread_id":{"type":"string","title":"Thread Id"},"resend_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resend Id"},"to_email":{"type":"string","title":"To Email"}},"type":"object","required":["thread_id","to_email"],"title":"ReactivationSendTestResponse"},"ReconcileBudgetsTickResponse":{"properties":{"projects_scanned":{"type":"integer","title":"Projects Scanned","default":0},"projects_drift":{"type":"integer","title":"Projects Drift","default":0},"projects_healed":{"type":"integer","title":"Projects Healed","default":0},"skipped":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skipped"}},"type":"object","title":"ReconcileBudgetsTickResponse","description":"Counters from one budget-reconcile cron pass. Each healed project had\ndrift between ``project.daily_budget_usd`` and the sum of its outreach\nsegments' ``daily_limit_usd`` and was repaired via even-delta on the\nsegments (the cap itself is never touched)."},"ReferralInfoResponse":{"properties":{"code":{"type":"string","title":"Code","default":""},"link":{"type":"string","title":"Link","default":""},"reward_usd":{"type":"integer","title":"Reward Usd"},"cap_usd":{"type":"integer","title":"Cap Usd"},"earned_usd":{"type":"integer","title":"Earned Usd"},"banned":{"type":"boolean","title":"Banned","default":false},"rows":{"items":{"$ref":"#/components/schemas/ReferralRow"},"type":"array","title":"Rows","default":[]}},"type":"object","required":["reward_usd","cap_usd","earned_usd"],"title":"ReferralInfoResponse","description":"Everything the referral page renders: the org's share link + the ledger.\n\n``banned=True`` (T-980 fraud clawback) → ``code``/``link`` are empty and\nthe page shows a \"program not available\" state instead of the share card."},"ReferralRow":{"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"invited_at":{"type":"string","format":"date-time","title":"Invited At"},"status":{"type":"string","enum":["pending","card_verified","granted","rejected"],"title":"Status"},"reward_usd":{"type":"integer","title":"Reward Usd","default":0}},"type":"object","required":["invited_at","status"],"title":"ReferralRow","description":"One invited identity for the referral page table (T-17).\n\n``email`` is privacy-masked server-side (``d•••@company.com``); None for a\nlink visit that hasn't signed up yet. ``status`` is the UI vocabulary:\n``pending`` (visited / card pending) · ``card_verified`` (card attached,\nbonus awaits their first payment — T-983) · ``granted`` (both bonuses\npaid) · ``rejected`` (self-referral / farm / cap — never paid)."},"RenameMailboxRequest":{"properties":{"from_name":{"type":"string","title":"From Name"}},"type":"object","required":["from_name"],"title":"RenameMailboxRequest"},"ReplyOrMeetingRate":{"properties":{"low":{"type":"number","title":"Low"},"high":{"type":"number","title":"High"}},"type":"object","required":["low","high"],"title":"ReplyOrMeetingRate"},"ReplyPreviewCase":{"properties":{"lead_name":{"type":"string","title":"Lead Name"},"lead_company":{"type":"string","title":"Lead Company"},"person_id":{"type":"string","title":"Person Id","default":""},"thread":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Thread"}},"type":"object","required":["lead_name","lead_company"],"title":"ReplyPreviewCase","description":"The conversation a reply draft would answer — resolved without any LLM\ncall, so the Replies tab can render it the moment it opens (T-1906);\nthe draft itself still generates separately."},"ReplyPreviewCaseResponse":{"properties":{"case":{"anyOf":[{"$ref":"#/components/schemas/ReplyPreviewCase"},{"type":"null"}]}},"type":"object","title":"ReplyPreviewCaseResponse"},"ReplyPreviewLeadOption":{"properties":{"person_id":{"type":"string","title":"Person Id"},"lead_name":{"type":"string","title":"Lead Name"},"lead_company":{"type":"string","title":"Lead Company"},"has_reply":{"type":"boolean","title":"Has Reply"},"inbound_excerpt":{"type":"string","title":"Inbound Excerpt","default":""},"profile_photo_url":{"type":"string","title":"Profile Photo Url","default":""},"company_domain":{"type":"string","title":"Company Domain","default":""},"company_logo_url":{"type":"string","title":"Company Logo Url","default":""}},"type":"object","required":["person_id","lead_name","lead_company","has_reply"],"title":"ReplyPreviewLeadOption","description":"One entry of the reply-composer's lead picker."},"ReplyPreviewLeadsResponse":{"properties":{"leads":{"items":{"$ref":"#/components/schemas/ReplyPreviewLeadOption"},"type":"array","title":"Leads"}},"type":"object","title":"ReplyPreviewLeadsResponse"},"ReplyPreviewRequest":{"properties":{"instructions":{"anyOf":[{"type":"string","maxLength":3000},{"type":"null"}],"title":"Instructions"},"person_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Person Id"}},"type":"object","title":"ReplyPreviewRequest","description":"POST /projects/{id}/reply-preview — generate a throwaway reply draft\nagainst a real case from the project using the DRAFT instructions the\nuser is typing (not a saved field)."},"ReplyPreviewResponse":{"properties":{"subject":{"type":"string","title":"Subject"},"body":{"type":"string","title":"Body"},"lead_name":{"type":"string","title":"Lead Name"},"lead_company":{"type":"string","title":"Lead Company"},"person_id":{"type":"string","title":"Person Id","default":""},"inbound_subject":{"type":"string","title":"Inbound Subject"},"inbound_excerpt":{"type":"string","title":"Inbound Excerpt"},"sample":{"type":"boolean","title":"Sample"},"model":{"type":"string","title":"Model"},"highlights":{"items":{"$ref":"#/components/schemas/EmailHighlight"},"type":"array","title":"Highlights"},"thread":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Thread"}},"type":"object","required":["subject","body","lead_name","lead_company","inbound_subject","inbound_excerpt","sample","model"],"title":"ReplyPreviewResponse"},"RetargetRequest":{"properties":{"target_geo":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Target Geo"},"target_company_size":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Target Company Size"}},"type":"object","title":"RetargetRequest","description":"Global Targeting screen \"Save & re-search\" payload (T-286).\n\nBoth fields are free-text prompts the agent reads as instructions (not hard\nfilters). Either may be sent; an empty string clears the field. Applied to\nthe segment, then — if the segment is live — its agent is nudged to re-search."},"RetargetResponse":{"properties":{"segment":{"$ref":"#/components/schemas/SegmentBrief"},"action":{"type":"string","title":"Action"}},"type":"object","required":["segment","action"],"title":"RetargetResponse"},"RetireMailboxesBody":{"properties":{"emails":{"items":{"type":"string"},"type":"array","title":"Emails"},"reason":{"type":"string","title":"Reason","default":"vendor_return"}},"type":"object","required":["emails"],"title":"RetireMailboxesBody"},"RetroDispatchTickResponse":{"properties":{"dispatched":{"type":"integer","title":"Dispatched","default":0},"skipped":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skipped"}},"type":"object","title":"RetroDispatchTickResponse","description":"Counters from one retro-dispatch cron pass. ``dispatched`` is the number\nof pending retrospectives launched this tick; ``skipped`` is a short reason\nwhen the handler took no action (e.g. the self-lock was already held)."},"ReviewActionRequest":{"properties":{"action":{"type":"string","enum":["approve","reject","cancel_auto_approve"],"title":"Action"},"feedback":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Feedback"}},"type":"object","required":["action"],"title":"ReviewActionRequest"},"RunRequest":{"properties":{"explee_id":{"type":"string","title":"Explee Id","default":""},"domain":{"type":"string","title":"Domain","default":""},"description":{"type":"string","title":"Description","default":""},"device_id":{"type":"string","title":"Device Id","default":""}},"type":"object","title":"RunRequest"},"RunStatusResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"trajectory_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trajectory Url"},"steps":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Steps"},"messages":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Messages"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"progress_percent":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress Percent"}},"type":"object","required":["job_id","status"],"title":"RunStatusResponse"},"SaveFollowupRulesRequest":{"properties":{"rules":{"$ref":"#/components/schemas/SegmentFollowupRules"}},"type":"object","required":["rules"],"title":"SaveFollowupRulesRequest","description":"One follow-up sequence applied to every campaign (\"apply to all\").\nPer-campaign edits go through PATCH /segments/{id}, not this endpoint."},"SaveLinksRequest":{"properties":{"shared_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Shared Url"},"per_segment":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object"},{"type":"null"}],"title":"Per Segment"}},"type":"object","title":"SaveLinksRequest","description":"Exactly one of shared_url / per_segment must be provided."},"SaveOkResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true}},"type":"object","title":"SaveOkResponse"},"SaveProjectScheduleRequest":{"properties":{"schedule":{"$ref":"#/components/schemas/SegmentScheduleUpdate"}},"type":"object","required":["schedule"],"title":"SaveProjectScheduleRequest","description":"One send schedule applied atomically to every campaign in a project."},"SaveTemplatesRequest":{"properties":{"shared":{"$ref":"#/components/schemas/TemplateEntry"},"except_segment_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Except Segment Ids"}},"type":"object","required":["shared"],"title":"SaveTemplatesRequest","description":"One template (first-email + follow-up briefs + language) applied to every\ncampaign (\"apply to all\"). Per-campaign edits go through PATCH /segments/{id},\nnot this endpoint."},"ScheduleCountriesResponse":{"properties":{"countries":{"items":{"$ref":"#/components/schemas/ScheduleCountryRow"},"type":"array","title":"Countries"},"other_countries":{"type":"integer","title":"Other Countries"}},"type":"object","required":["countries","other_countries"],"title":"ScheduleCountriesResponse"},"ScheduleCountryRow":{"properties":{"code":{"type":"string","title":"Code"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"business_hours_start":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Business Hours Start"},"business_hours_end":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Business Hours End"},"fri_sat_weekend":{"type":"boolean","title":"Fri Sat Weekend"}},"type":"object","required":["code","timezone","business_hours_start","business_hours_end","fri_sat_weekend"],"title":"ScheduleCountryRow"},"SchedulerCalendarStatus":{"properties":{"google_connected":{"type":"boolean","title":"Google Connected"}},"type":"object","required":["google_connected"],"title":"SchedulerCalendarStatus"},"SchedulerProvisionRequest":{"properties":{"destination":{"type":"string","enum":["default","availability","google_calendar","calendar_management"],"title":"Destination","default":"default"}},"type":"object","title":"SchedulerProvisionRequest"},"SchedulerProvisionResponse":{"properties":{"url":{"type":"string","title":"Url"},"schedule_id":{"type":"integer","title":"Schedule Id"},"booking_url":{"type":"string","title":"Booking Url"}},"type":"object","required":["url","schedule_id","booking_url"],"title":"SchedulerProvisionResponse"},"SearchCompaniesRequest":{"properties":{"keywords":{"items":{"type":"string"},"type":"array","title":"Keywords"},"limit":{"type":"integer","title":"Limit","default":20}},"type":"object","required":["keywords"],"title":"SearchCompaniesRequest"},"SearchHistoryItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"companies_filters":{"anyOf":[{"$ref":"#/components/schemas/CompaniesSearchFilters"},{"type":"null"}]},"people_filters":{"anyOf":[{"$ref":"#/components/schemas/PeopleSearchFilters"},{"type":"null"}]},"deduplication":{"anyOf":[{"$ref":"#/components/schemas/DeduplicationSettings"},{"type":"null"}]},"extra_columns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extra Columns"}},"type":"object","required":["id","name","created_at"],"title":"SearchHistoryItem"},"SegmentBrief":{"properties":{"name":{"type":"string","title":"Name","description":"Short campaign / segment name (2-4 words)"},"pain":{"type":"string","title":"Pain","description":"Core pain this ICP has (max ~10 words)","default":""},"use_case":{"type":"string","title":"Use Case","description":"What this ICP does with the product (max ~15 words)","default":""},"keywords":{"type":"string","title":"Keywords","description":"Comma-separated search keywords (5-8, lowercase, 1-3 words each)","default":""},"positive_criterias":{"items":{"type":"string"},"type":"array","title":"Positive Criterias","description":"Positive signals identifying this buyer (qualitative, 3-5 words each)"},"negative_criterias":{"items":{"type":"string"},"type":"array","title":"Negative Criterias","description":"Disqualifying signals — look-alikes that are NOT a fit"},"example_clients":{"items":{"type":"string"},"type":"array","title":"Example Clients","description":"Recognizable example companies that fit this ICP"},"decision_maker":{"type":"string","title":"Decision Maker","description":"Who to reach at the prospect, framed by responsibility","default":""},"target_geo":{"type":"string","title":"Target Geo","description":"Target geographies — country names, comma-separated","default":""},"target_company_size":{"type":"string","title":"Target Company Size","description":"Target company size — free-text prompt, e.g. \"mid-market and enterprise\", \"startups under 50\"","default":""},"id":{"type":"integer","title":"Id"},"description":{"type":"string","title":"Description"},"context":{"type":"string","title":"Context","default":""},"daily_limit_usd":{"type":"integer","title":"Daily Limit Usd"},"paused":{"type":"boolean","title":"Paused","default":false},"agent_turn_running":{"type":"boolean","title":"Agent Turn Running","default":false},"instructions":{"type":"string","title":"Instructions","default":""},"followup_instructions":{"type":"string","title":"Followup Instructions","default":""},"language":{"type":"string","title":"Language","default":"auto"},"target_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Url"},"email_templates":{"additionalProperties":{"$ref":"#/components/schemas/EmailTemplateEntry"},"type":"object","title":"Email Templates"},"email_templates_version":{"type":"integer","title":"Email Templates Version","default":0},"updated_at":{"type":"string","title":"Updated At","default":""},"people_count":{"type":"integer","title":"People Count","default":0},"preview_leads":{"items":{"$ref":"#/components/schemas/PreviewLead"},"type":"array","title":"Preview Leads"},"cached_previews":{"items":{"$ref":"#/components/schemas/GeneratedEmailPayload"},"type":"array","title":"Cached Previews"},"schedule":{"anyOf":[{"$ref":"#/components/schemas/SegmentSchedule"},{"type":"null"}]},"followup_rules":{"anyOf":[{"$ref":"#/components/schemas/SegmentFollowupRules"},{"type":"null"}]},"report_frequency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Frequency"},"status_display":{"anyOf":[{"$ref":"#/components/schemas/StatusDisplay"},{"type":"null"}]}},"type":"object","required":["name","id","description","daily_limit_usd"],"title":"SegmentBrief"},"SegmentBudgetResponse":{"properties":{"segment_id":{"type":"integer","title":"Segment Id"},"daily_limit_usd":{"type":"integer","title":"Daily Limit Usd"},"project_daily_budget_usd":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Daily Budget Usd"}},"type":"object","required":["segment_id","daily_limit_usd"],"title":"SegmentBudgetResponse","description":"Result of a per-campaign budget edit — the campaign's new budget and the\nproject total that followed it (total = sum of campaign budgets)."},"SegmentFollowupRules":{"properties":{"max_touches":{"type":"integer","maximum":3.0,"minimum":1.0,"title":"Max Touches","default":1},"delay_days":{"anyOf":[{"type":"integer","maximum":30.0,"minimum":1.0},{"type":"null"}],"title":"Delay Days"},"stop_on_reply":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stop On Reply"}},"type":"object","title":"SegmentFollowupRules"},"SegmentInfo":{"properties":{"id":{"type":"integer","title":"Id"},"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"status":{"type":"string","title":"Status"},"status_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Reason"},"people_count":{"type":"integer","title":"People Count","default":0},"pain":{"type":"string","title":"Pain","default":""},"use_case":{"type":"string","title":"Use Case","default":""},"positive_criterias":{"items":{"type":"string"},"type":"array","title":"Positive Criterias"},"example_clients":{"items":{"type":"string"},"type":"array","title":"Example Clients"},"daily_limit_usd":{"type":"integer","title":"Daily Limit Usd","default":10},"target_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Url"},"instructions":{"type":"string","title":"Instructions","default":""},"language":{"type":"string","title":"Language","default":""},"followup_instructions":{"type":"string","title":"Followup Instructions","default":""},"followup_rules":{"anyOf":[{"$ref":"#/components/schemas/SegmentFollowupRules"},{"type":"null"}]},"target_geo":{"type":"string","title":"Target Geo","default":""},"target_company_size":{"type":"string","title":"Target Company Size","default":""},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"status_display":{"anyOf":[{"$ref":"#/components/schemas/StatusDisplay"},{"type":"null"}]}},"type":"object","required":["id","name","description","status"],"title":"SegmentInfo"},"SegmentLeadsResponse":{"properties":{"meta":{"$ref":"#/components/schemas/LeadsMeta"},"companies":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Companies"},"people":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"People"}},"type":"object","required":["meta","companies","people"],"title":"SegmentLeadsResponse"},"SegmentResponse":{"properties":{"segment":{"$ref":"#/components/schemas/SegmentBrief"},"docs":{"items":{"$ref":"#/components/schemas/DocItem"},"type":"array","title":"Docs"}},"type":"object","required":["segment","docs"],"title":"SegmentResponse"},"SegmentSchedule":{"properties":{"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"},"working_hours":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Working Hours"},"days":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Days"},"use_system_schedule":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use System Schedule"},"days_source":{"anyOf":[{"type":"string","enum":["system","user"]},{"type":"null"}],"title":"Days Source"},"days_backfill_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Backfill Version"}},"additionalProperties":false,"type":"object","title":"SegmentSchedule"},"SegmentScheduleUpdate":{"properties":{"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"},"working_hours":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Working Hours"},"days":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Days"},"use_system_schedule":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use System Schedule"}},"additionalProperties":false,"type":"object","title":"SegmentScheduleUpdate"},"SegmentSpentTodayResponse":{"properties":{"segment_id":{"type":"integer","title":"Segment Id"},"spent_today_usd":{"type":"number","title":"Spent Today Usd"},"daily_limit_usd":{"type":"integer","title":"Daily Limit Usd"}},"type":"object","required":["segment_id","spent_today_usd","daily_limit_usd"],"title":"SegmentSpentTodayResponse","description":"Per-segment \"spent today\" snapshot for the Budget tab progress bar.\n\n`daily_limit_usd` is included so the UI can render a single-call\nprogress bar without also fetching the full SegmentBrief — the bar\nauto-refetches every ~30s, the brief doesn't need to."},"SegmentSummary":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"status_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Reason"},"people_count":{"type":"integer","title":"People Count","default":0},"unreplied_hot_count":{"type":"integer","title":"Unreplied Hot Count","default":0},"status_display":{"anyOf":[{"$ref":"#/components/schemas/StatusDisplay"},{"type":"null"}]}},"type":"object","required":["id","name","status"],"title":"SegmentSummary","description":"Lightweight segment shape for the sidebar + redirect picker.\n\nFull ``SegmentInfo`` carries Docs-tab fields (pain, use_case, clients)\nthat are useless for navigation; this trimmed version keeps the\n``/user`` payload small when projects start adding up."},"SegmentUpdateRequest":{"properties":{"instructions":{"anyOf":[{"type":"string","maxLength":3000},{"type":"null"}],"title":"Instructions"},"followup_instructions":{"anyOf":[{"type":"string","maxLength":3000},{"type":"null"}],"title":"Followup Instructions"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"target_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Target Url"},"email_templates":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/EmailTemplateEntry"},"type":"object"},{"type":"null"}],"title":"Email Templates"},"schedule":{"anyOf":[{"$ref":"#/components/schemas/SegmentScheduleUpdate"},{"type":"null"}]},"followup_rules":{"anyOf":[{"$ref":"#/components/schemas/SegmentFollowupRules"},{"type":"null"}]},"report_frequency":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Report Frequency"},"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"pain":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Pain"},"use_case":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Use Case"},"positive_criterias":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":20},{"type":"null"}],"title":"Positive Criterias"},"negative_criterias":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":20},{"type":"null"}],"title":"Negative Criterias"},"example_clients":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50},{"type":"null"}],"title":"Example Clients"},"context":{"anyOf":[{"type":"string","maxLength":50000},{"type":"null"}],"title":"Context"},"decision_maker":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Decision Maker"},"target_geo":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Target Geo"},"target_company_size":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Target Company Size"}},"type":"object","title":"SegmentUpdateRequest"},"SelfReportedSourceRequest":{"properties":{"source":{"type":"string","maxLength":255,"minLength":1,"title":"Source"}},"type":"object","required":["source"],"title":"SelfReportedSourceRequest"},"SendInviteRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"SendInviteRequest"},"SendingIdentityDomain":{"properties":{"domain":{"type":"string","title":"Domain"},"status":{"type":"string","title":"Status"}},"type":"object","required":["domain","status"],"title":"SendingIdentityDomain","description":"One org-owned sending domain (T-41) with its lifecycle status\n('warming' | 'active'; the PR-6 DNS checker may add advisory states)."},"SendingIdentityResponse":{"properties":{"pool":{"type":"string","enum":["shared","dedicated"],"title":"Pool"},"domains":{"items":{"$ref":"#/components/schemas/SendingIdentityDomain"},"type":"array","title":"Domains"},"from_names":{"items":{"type":"string"},"type":"array","title":"From Names"},"byo_enabled":{"type":"boolean","title":"Byo Enabled","default":false}},"type":"object","required":["pool","domains","from_names"],"title":"SendingIdentityResponse","description":"Read-only sender visibility for the current org (T-41 PR-4).\n\n``pool`` mirrors the send-side picker gate: 'dedicated' only when the\norg owns at least one active dedicated mailbox — i.e. when sends\nactually pick org-owned boxes. An org whose domains are all still\nwarming stays 'shared'. For a shared-pool org every field is the empty\nshell on purpose: the operator fleet's domains and mailboxes are never\nexposed (the UI names that pool \"Pre-warmed mailboxes\", nothing more)."},"SentResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/SentRow"},"type":"array","title":"Rows"}},"type":"object","required":["rows"],"title":"SentResponse"},"SentRow":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"account_ref":{"type":"string","title":"Account Ref"},"profile_url":{"type":"string","title":"Profile Url"},"kind":{"type":"string","title":"Kind"},"body_text":{"type":"string","title":"Body Text"},"status":{"type":"string","title":"Status"},"connection_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connection State"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"sent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sent At"}},"type":"object","required":["id","created_at","account_ref","profile_url","kind","body_text","status","connection_state","error","sent_at"],"title":"SentRow"},"SetLeadNoteRequest":{"properties":{"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","title":"SetLeadNoteRequest"},"SetLeadStatusRequest":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"SetLeadStatusRequest"},"SetProjectBudgetRequest":{"properties":{"daily_budget_usd":{"type":"integer","minimum":0.0,"title":"Daily Budget Usd"},"surface":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Surface"}},"type":"object","required":["daily_budget_usd"],"title":"SetProjectBudgetRequest","description":"Body for PATCH /projects/{id}/budget — set the project budget cap.\n\n``ge=0``: $0 is the explicit \"pause everything\" anchor (issue: user wants a\none-knob off switch). At $0 every per-campaign allocation zeroes out, so the\ndaily-limit gate in ``billing`` blocks all cold sends while campaigns keep\ntheir setup (status unchanged — paused, not deleted). The slider enforces the\n0 ↔ positive-min stepping (no $1..min-1); the server stays permissive at >= 0."},"SetSegmentBudgetRequest":{"properties":{"daily_limit_usd":{"type":"integer","maximum":300.0,"minimum":1.0,"title":"Daily Limit Usd"}},"type":"object","required":["daily_limit_usd"],"title":"SetSegmentBudgetRequest","description":"Body for PATCH /segments/{id}/budget — the user edits ONE campaign's\ndaily budget from the dashboard table (T-558, Variant C). Clamped to the\nper-campaign bounds; the server stays permissive within [MIN, MAX] (ADR-0004,\nthe UI floor lives in ``projections``)."},"SetupStepResponse":{"properties":{"key":{"type":"string","title":"Key"},"done":{"type":"boolean","title":"Done"},"data_backed":{"type":"boolean","title":"Data Backed"}},"type":"object","required":["key","done","data_backed"],"title":"SetupStepResponse"},"SizeDistItem":{"properties":{"range":{"type":"string","title":"Range"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["range","count"],"title":"SizeDistItem"},"StartRunResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status","default":"pending"}},"type":"object","required":["job_id"],"title":"StartRunResponse"},"StartSessionRequest":{"properties":{"segment_id":{"type":"string","title":"Segment Id"}},"type":"object","required":["segment_id"],"title":"StartSessionRequest"},"StarvationBatchItem":{"properties":{"project_id":{"type":"integer","title":"Project Id"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["project_id","reason"],"title":"StarvationBatchItem","description":"One supply-class revive candidate from the leadfinder detector\n(T-1943 inc. 2). ``reason`` must be a known class — validated against\n``agent_chat_retro_actor.STARVATION_BATCH_REASONS`` (it becomes the retro\nrow's ``trigger_reason``, i.e. the attempt journal)."},"StarvationBatchRequest":{"properties":{"items":{"items":{"$ref":"#/components/schemas/StarvationBatchItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"StarvationBatchRequest"},"StatusBody":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"StatusBody"},"StatusDisplay":{"properties":{"value":{"type":"string","title":"Value"},"label":{"type":"string","title":"Label"},"tone":{"type":"string","title":"Tone"},"animated":{"type":"boolean","title":"Animated"},"hint":{"type":"string","title":"Hint"},"detail":{"type":"string","title":"Detail"},"manual_start_blocked":{"type":"boolean","title":"Manual Start Blocked","default":false}},"type":"object","required":["value","label","tone","animated","hint","detail"],"title":"StatusDisplay","description":"Unified status display object added to every client-facing segment payload.\n\nComputed once in _build_status_display; emitted as `status_display` on the\nwire. All legacy fields (status, paused, status_reason, agent_turn_running)\nremain unchanged for deploy-skew safety.\n\nIteration-1 value vocabulary:\n    not_started | searching | review | outreach | paused | budget_paused |\n    listening | resuming | archived | error\n(`budget_paused` is the display-only $0-budget mask — see\n_ZERO_BUDGET_MASKED_STATES; no matching lifecycle status exists.)"},"StatusLineResponse":{"properties":{"plaque":{"anyOf":[{"$ref":"#/components/schemas/StatusPlaque"},{"type":"null"}]},"next_send_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Send At"},"sent_today":{"type":"integer","title":"Sent Today"},"queued":{"type":"integer","title":"Queued"}},"type":"object","required":["sent_today","queued"],"title":"StatusLineResponse","description":"Wire shape for the cabinet status line — T-2712 trimmed it to what the\nv5 plaque actually draws.\n\n``plaque`` is the state; the three counters below fill the healthy\nfamily's detail line. ``plaque = None`` means \"show no plaque\", which is\na real state, not a gap: the money CTAs carry their own verdict."},"StatusPlaque":{"properties":{"state":{"type":"string","enum":["start_campaign","retry_launch","resume","review","all_archived","leads_exhausted","setting_up","sending","scheduled","budget_tomorrow","next_batch"],"title":"State"},"segments":{"items":{"$ref":"#/components/schemas/PlaqueSegment"},"type":"array","title":"Segments","default":[]},"campaign_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Name"},"campaigns_count":{"type":"integer","title":"Campaigns Count","default":0},"icp_exhausted":{"type":"boolean","title":"Icp Exhausted","default":false}},"type":"object","required":["state"],"title":"StatusPlaque","description":"The winning plaque state + everything its buttons need.\n\nOne flat model rather than a per-state discriminated union: the states\ndiffer by two or three fields, not by shape, and a union of eleven\npayloads would be more wire vocabulary than logic. What each field means\nis always the same — which campaigns the buttons act on, how many\ncampaigns the state covers, and the one campaign the copy names."},"StatusResponse":{"properties":{"token_configured":{"type":"boolean","title":"Token Configured"},"accounts":{"items":{"$ref":"#/components/schemas/AccountOut"},"type":"array","title":"Accounts"},"accounts_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accounts Error"},"sent_total":{"type":"integer","title":"Sent Total"}},"type":"object","required":["token_configured","accounts","sent_total"],"title":"StatusResponse"},"StopFeedbackRequest":{"properties":{"source":{"type":"string","title":"Source"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"project_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Id"},"reason_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason Code"},"show_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Show Id"}},"type":"object","required":["source"],"title":"StopFeedbackRequest"},"SyncResponse":{"properties":{"queued":{"type":"integer","title":"Queued"}},"type":"object","required":["queued"],"title":"SyncResponse"},"SyncStatesResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/SyncStatesResultRow"},"type":"array","title":"Results"},"accepted_count":{"type":"integer","title":"Accepted Count"}},"type":"object","required":["results","accepted_count"],"title":"SyncStatesResponse"},"SyncStatesResultRow":{"properties":{"provider_lead_ref":{"type":"string","title":"Provider Lead Ref"},"account_ref":{"type":"string","title":"Account Ref"},"connection_state":{"type":"string","title":"Connection State"},"changed":{"type":"boolean","title":"Changed"}},"type":"object","required":["provider_lead_ref","account_ref","connection_state","changed"],"title":"SyncStatesResultRow"},"TaskSnapshotResponse":{"properties":{"task_id":{"type":"string","title":"Task Id"},"agent_id":{"type":"string","title":"Agent Id"},"headers":{"items":{"type":"string"},"type":"array","title":"Headers"},"rows":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Rows"},"row_states":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Row States"}},"type":"object","required":["task_id","agent_id","headers","rows","row_states"],"title":"TaskSnapshotResponse"},"TaskSummary":{"properties":{"task_id":{"type":"string","title":"Task Id"},"agent_id":{"type":"string","title":"Agent Id"},"agent_name":{"type":"string","title":"Agent Name"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"total_rows":{"type":"integer","title":"Total Rows"},"completed_rows":{"type":"integer","title":"Completed Rows"},"errored_rows":{"type":"integer","title":"Errored Rows"},"running_rows":{"type":"integer","title":"Running Rows"}},"type":"object","required":["task_id","agent_id","agent_name","created_at","updated_at","total_rows","completed_rows","errored_rows","running_rows"],"title":"TaskSummary"},"TemplateEntry":{"properties":{"instructions":{"anyOf":[{"type":"string","maxLength":3000},{"type":"null"}],"title":"Instructions"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"followup_instructions":{"anyOf":[{"type":"string","maxLength":3000},{"type":"null"}],"title":"Followup Instructions"}},"type":"object","title":"TemplateEntry"},"TestSubmissionRequest":{"properties":{"vacancy_slug":{"type":"string","maxLength":64,"title":"Vacancy Slug"},"name":{"type":"string","maxLength":200,"title":"Name","default":""},"contact":{"type":"string","maxLength":300,"title":"Contact"},"channel":{"type":"string","maxLength":100,"title":"Channel","default":""},"dashboard_link":{"type":"string","maxLength":500,"title":"Dashboard Link","default":""},"report_link":{"type":"string","maxLength":500,"title":"Report Link","default":""},"comment":{"type":"string","maxLength":8000,"title":"Comment","default":""},"alerts_filename":{"type":"string","maxLength":300,"title":"Alerts Filename"},"alerts_base64":{"type":"string","maxLength":2796210,"title":"Alerts Base64"},"code_filename":{"type":"string","maxLength":300,"title":"Code Filename","default":""},"code_base64":{"type":"string","maxLength":2796210,"title":"Code Base64","default":""},"trace1_filename":{"type":"string","maxLength":300,"title":"Trace1 Filename","default":""},"trace1_base64":{"type":"string","maxLength":6990514,"title":"Trace1 Base64","default":""},"trace2_filename":{"type":"string","maxLength":300,"title":"Trace2 Filename","default":""},"trace2_base64":{"type":"string","maxLength":6990514,"title":"Trace2 Base64","default":""},"harness_filename":{"type":"string","maxLength":300,"title":"Harness Filename","default":""},"harness_base64":{"type":"string","maxLength":6990514,"title":"Harness Base64","default":""},"stand_fingerprint":{"type":"string","maxLength":32,"title":"Stand Fingerprint","default":""},"stand_world_epoch":{"type":"string","maxLength":32,"title":"Stand World Epoch","default":""},"website":{"type":"string","maxLength":500,"title":"Website","default":""}},"type":"object","required":["vacancy_slug","contact","alerts_filename","alerts_base64"],"title":"TestSubmissionRequest","description":"The test-task submit form (web/app/ai-native-developer/test/submit/route.ts).\nRequired: a way to reach back and the Task-1 alerts log (its timestamps carry\nthe monitor window — no self-reported window, no stand key: the stand is one\nshared keyless world). Everything else optional — partial submissions are\nwelcome by design. trace1/trace2 are the per-task agent traces (Task 1/2)."},"ThreadMessageOut":{"properties":{"direction":{"type":"string","title":"Direction"},"kind":{"type":"string","title":"Kind"},"text":{"type":"string","title":"Text"},"at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"At"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"}},"type":"object","required":["direction","kind","text","at","status","error"],"title":"ThreadMessageOut"},"TrackBody":{"properties":{"subject_type":{"type":"string","title":"Subject Type"},"subject_id":{"type":"string","title":"Subject Id"},"name":{"type":"string","title":"Name"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"ts":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ts"},"props":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Props"}},"type":"object","required":["subject_type","subject_id","name"],"title":"TrackBody"},"TransitionRequest":{"properties":{"to":{"type":"string","enum":["discovery","review","outreach","listening","archived","error"],"title":"To"},"reason":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Reason"}},"type":"object","required":["to"],"title":"TransitionRequest"},"TriggerRetrospectiveResponse":{"properties":{"retrospective_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Retrospective Id"},"scheduled":{"type":"boolean","title":"Scheduled"}},"type":"object","required":["scheduled"],"title":"TriggerRetrospectiveResponse","description":"Body for POST /projects/{id}/retrospectives — manual orchestrator run.\n\n`retrospective_id` is None when an active retrospective already covers the\nproject (the partial-unique gate declined a duplicate); `scheduled` reflects\nwhether a new run was enqueued."},"UnreadCountsResponse":{"properties":{"by_segment":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Segment","default":{}},"by_project":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Project","default":{}}},"type":"object","title":"UnreadCountsResponse","description":"Unreplied-hot-lead counts for the sidebar badges, served separately\nfrom ``/user`` so the heavy ``unreplied_hot`` CTE never blocks the\napp-shell render. Keys are stringified ids (JSON object keys).\n``by_segment`` drives the active project's per-campaign badges;\n``by_project`` (sum over a project's segments) drives the dropdown badge.\nOnly non-zero entries are included."},"UpdateHistoryItemPayload":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"UpdateHistoryItemPayload"},"UpdateOrganizationRequest":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"UpdateOrganizationRequest"},"UpdateUserRoleRequest":{"properties":{"user_id":{"type":"string","title":"User Id"},"role":{"type":"string","title":"Role"}},"type":"object","required":["user_id","role"],"title":"UpdateUserRoleRequest"},"UpgradePayload":{"properties":{"plan":{"type":"string","title":"Plan"},"success_url":{"type":"string","title":"Success Url","default":"https://explee.com/top-up/success"},"cancel_url":{"type":"string","title":"Cancel Url","default":"https://explee.com/top-up/canceled"},"redirect_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Url"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["plan"],"title":"UpgradePayload"},"UsageDailyDay":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"emails_sent":{"type":"integer","title":"Emails Sent"},"credits":{"type":"number","title":"Credits"},"usd":{"type":"number","title":"Usd"},"projects":{"items":{"$ref":"#/components/schemas/UsageDailyProject"},"type":"array","title":"Projects"}},"type":"object","required":["date","emails_sent","credits","usd","projects"],"title":"UsageDailyDay","description":"One UTC day of cold-send usage for the Billing \"Usage\" panel.\n\n``emails_sent`` counts successfully sent cold emails (sent_at day);\n``credits``/``usd`` derive as emails × price — the project-dashboard\nspend convention (exact vs the ledger: no email refunds exist, replies\nare excluded). ``projects`` is always populated — the UI renders\nsub-lines only for days with more than one project."},"UsageDailyProject":{"properties":{"project_id":{"type":"string","title":"Project Id"},"name":{"type":"string","title":"Name"},"emails":{"type":"integer","title":"Emails"},"usd":{"type":"number","title":"Usd"}},"type":"object","required":["project_id","name","emails","usd"],"title":"UsageDailyProject","description":"Per-project slice of one usage day (breakdown sub-lines in the UI)."},"UsageDailyResponse":{"properties":{"days":{"items":{"$ref":"#/components/schemas/UsageDailyDay"},"type":"array","title":"Days"},"total_emails":{"type":"integer","title":"Total Emails"},"total_credits":{"type":"number","title":"Total Credits"},"total_usd":{"type":"number","title":"Total Usd"},"trial_usd":{"type":"number","title":"Trial Usd","default":0.0},"paid_usd":{"type":"number","title":"Paid Usd","default":0.0}},"type":"object","required":["days","total_emails","total_credits","total_usd"],"title":"UsageDailyResponse","description":"Usage-by-day window for the Billing tab (T-638).\n\n``days`` covers every UTC day of the window, zero days included,\nnewest first. Totals are over the whole window."},"UserContextResponse":{"properties":{"projects":{"items":{"$ref":"#/components/schemas/ProjectSummary"},"type":"array","title":"Projects"},"archived_projects":{"items":{"$ref":"#/components/schemas/ArchivedProjectSummary"},"type":"array","title":"Archived Projects","default":[]},"has_autogtm_trial":{"type":"boolean","title":"Has Autogtm Trial","default":false},"talk_to_us":{"type":"boolean","title":"Talk To Us","default":false}},"type":"object","required":["projects"],"title":"UserContextResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VaultCardRequest":{"properties":{"device_id":{"type":"string","title":"Device Id"},"utm_source":{"type":"string","title":"Utm Source","default":""},"utm_medium":{"type":"string","title":"Utm Medium","default":""},"utm_campaign":{"type":"string","title":"Utm Campaign","default":""},"ref_code":{"type":"string","title":"Ref Code","default":""},"fbp":{"type":"string","title":"Fbp","default":""},"fbc":{"type":"string","title":"Fbc","default":""},"fbclid":{"type":"string","title":"Fbclid","default":""},"rdt_cid":{"type":"string","title":"Rdt Cid","default":""},"auto_recharge":{"type":"boolean","title":"Auto Recharge","default":false},"domain":{"type":"string","title":"Domain","default":""},"preferred_daily_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Preferred Daily Usd"},"token_intent_id":{"type":"string","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","title":"Token Intent Id"},"email":{"type":"string","maxLength":254,"pattern":"^[^{}]*$","title":"Email","default":""},"return_url":{"type":"string","maxLength":2048,"title":"Return Url","default":""}},"type":"object","required":["device_id","token_intent_id"],"title":"VaultCardRequest"},"WebSearchUIPayload":{"properties":{"query":{"type":"string","maxLength":500,"minLength":1,"title":"Query"}},"type":"object","required":["query"],"title":"WebSearchUIPayload"},"WebSearchUIResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/WebSearchUIResult"},"type":"array","title":"Results"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["results","total"],"title":"WebSearchUIResponse"},"WebSearchUIResult":{"properties":{"title":{"type":"string","title":"Title"},"snippet":{"type":"string","title":"Snippet"},"url":{"type":"string","title":"Url"}},"type":"object","required":["title","snippet","url"],"title":"WebSearchUIResult"},"WeeklyTrialDigestTickResponse":{"properties":{"cohort":{"type":"integer","title":"Cohort","default":0},"with_project":{"type":"integer","title":"With Project","default":0},"with_launch":{"type":"integer","title":"With Launch","default":0},"with_send":{"type":"integer","title":"With Send","default":0},"problematic":{"type":"integer","title":"Problematic","default":0},"posted":{"type":"boolean","title":"Posted","default":false},"skipped":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skipped"}},"type":"object","title":"WeeklyTrialDigestTickResponse","description":"Counters from one weekly trial-digest cron pass. ``problematic`` is the\nheadline (paid last week but 0 cold emails sent); ``posted`` is whether the\nSlack digest went out this tick; ``skipped`` is a short reason when the\nhandler took no action (lock held, not Tuesday, or already sent this week)."},"_EgressIp":{"properties":{"egress_ip":{"type":"string","title":"Egress Ip"},"socks_host":{"type":"string","title":"Socks Host"},"socks_port":{"type":"integer","title":"Socks Port"}},"type":"object","required":["egress_ip","socks_host","socks_port"],"title":"_EgressIp"},"_EgressRegister":{"properties":{"node_id":{"type":"string","title":"Node Id"},"provider":{"type":"string","title":"Provider"},"ssh_host":{"type":"string","title":"Ssh Host"},"reach":{"type":"string","title":"Reach","default":"tailnet"},"tailnet_ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tailnet Ip"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"provider_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Ref"},"ips":{"items":{"$ref":"#/components/schemas/_EgressIp"},"type":"array","title":"Ips"}},"type":"object","required":["node_id","provider","ssh_host","ips"],"title":"_EgressRegister"},"_ExreacherCallbackBody":{"properties":{"person":{"additionalProperties":true,"type":"object","title":"Person","default":{}},"exreacher_email_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exreacher Email Id"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","default":{}}},"type":"object","title":"_ExreacherCallbackBody","description":"Result POSTed by exreacher when an async find finishes (see\n`exreacher.schemas.ExreacherFindCallback`)."},"api__agent__router__StartRunRequest":{"properties":{"agent_id":{"type":"string","maxLength":128,"minLength":1,"title":"Agent Id"},"task_id":{"type":"string","title":"Task Id"},"row_id":{"type":"string","maxLength":36,"minLength":1,"title":"Row Id"},"row":{"additionalProperties":{"type":"string"},"type":"object","title":"Row"}},"type":"object","required":["agent_id","task_id","row_id","row"],"title":"StartRunRequest"},"api__agent_chat__playground__router__StartRunRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Sub-agent name from SUBAGENT_REGISTRY"},"user_message":{"type":"string","maxLength":200000,"minLength":1,"title":"User Message"},"model":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Model"},"tool_names":{"items":{"type":"string"},"type":"array","title":"Tool Names"},"cli_backend":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Cli Backend"}},"type":"object","required":["name","user_message"],"title":"StartRunRequest","description":"Body of ``POST /runs``.\n\n``tool_names`` is the user's full tool allowlist (not a delta against the\nsub-agent's default). An empty list means \"no MCP tools at all\".\n\n``cli_backend`` picks which CLI drives the run — ``'claude'`` (default)\nor ``'codex'``. Unknown values fall back to the global default at the\nworker layer rather than 4xx'ing here, so an out-of-date UI never blocks\na launch."},"api__experiments__router__BootstrapResponse":{"properties":{"device_id":{"type":"string","title":"Device Id"},"arms":{"additionalProperties":{"type":"string"},"type":"object","title":"Arms"}},"type":"object","required":["device_id","arms"],"title":"BootstrapResponse"},"api__outreach_linkedin__router__BootstrapResponse":{"properties":{"accounts":{"items":{"$ref":"#/components/schemas/AccountOut"},"type":"array","title":"Accounts"},"list_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"List Uuid"},"custom_field_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Field Uuid"},"connect_flow_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connect Flow Uuid"}},"type":"object","required":["accounts","list_uuid","custom_field_uuid","connect_flow_uuid"],"title":"BootstrapResponse"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}