{"openapi":"3.1.0","info":{"title":"Honeylead Pipeline API","version":"1.0.0"},"paths":{"/v1/auth/login":{"post":{"summary":"Login","operationId":"login_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/invite":{"post":{"summary":"Invite","description":"Admin-only: create a user account and send an invite email.\nRequires X-Admin-Secret header matching ADMIN_SECRET env var.\n\nBody: { email, name }","operationId":"invite_v1_auth_invite_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/forgot-password":{"post":{"summary":"Forgot Password","description":"Send a password-reset email. Always returns 200 to avoid user enumeration.","operationId":"forgot_password_v1_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/set-password":{"post":{"summary":"Set Password","description":"Validate a token (invite or reset) and set the user's password.\nReturns a JWT so the user is immediately logged in.","operationId":"set_password_v1_auth_set_password_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/register":{"post":{"summary":"Register","description":"Self-service signup. Creates a new user + workspace and returns a JWT.\nIf the email already exists returns 409 so the frontend can redirect to login.","operationId":"register_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/logout":{"post":{"summary":"Logout","operationId":"logout_v1_auth_logout_post","responses":{"204":{"description":"Successful Response"}}}},"/v1/auth/magic-link":{"post":{"summary":"Request Magic Link","description":"Send a one-time sign-in link to the user's email.\nCreates an account automatically if none exists.","operationId":"request_magic_link_v1_auth_magic_link_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/magic-link/verify":{"post":{"summary":"Verify Magic Link","description":"Verify a magic-link token and return a JWT + user object.","operationId":"verify_magic_link_v1_auth_magic_link_verify_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/google":{"get":{"summary":"Google Oauth Start","description":"Redirect browser to Google's OAuth consent screen.","operationId":"google_oauth_start_v1_auth_google_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/google/callback":{"get":{"summary":"Google Oauth Callback","description":"Exchange Google auth code for a user JWT, then redirect to the app.","operationId":"google_oauth_callback_v1_auth_google_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}},{"name":"error","in":"query","required":false,"schema":{"type":"string","default":"","title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/briefs":{"get":{"summary":"List Briefs","operationId":"list_briefs_v1_briefs_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Brief","operationId":"create_brief_v1_briefs_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/briefs/{brief_id}":{"get":{"summary":"Get Brief","operationId":"get_brief_v1_briefs__brief_id__get","parameters":[{"name":"brief_id","in":"path","required":true,"schema":{"type":"string","title":"Brief Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Brief","operationId":"update_brief_v1_briefs__brief_id__patch","parameters":[{"name":"brief_id","in":"path","required":true,"schema":{"type":"string","title":"Brief Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Archive Brief","operationId":"archive_brief_v1_briefs__brief_id__delete","parameters":[{"name":"brief_id","in":"path","required":true,"schema":{"type":"string","title":"Brief Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/briefs/{brief_id}/signals/{signal}/broaden":{"post":{"summary":"Broaden Signal","description":"User-triggered broaden: re-run ONE signal for this brief with a relaxed\nfilter (drop the size band, or widen the geography). Explicitly recruiter-\ninitiated, so the extra Crustdata spend is intended. Runs in a background\nthread and returns immediately; the UI re-polls /signals for the new leads.","operationId":"broaden_signal_v1_briefs__brief_id__signals__signal__broaden_post","parameters":[{"name":"brief_id","in":"path","required":true,"schema":{"type":"string","title":"Brief Id"}},{"name":"signal","in":"path","required":true,"schema":{"type":"string","title":"Signal"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/briefs/{brief_id}/signals":{"get":{"summary":"Get Brief Signals","description":"Return signal counts + recent leads for a brief's workspace panel.","operationId":"get_brief_signals_v1_briefs__brief_id__signals_get","parameters":[{"name":"brief_id","in":"path","required":true,"schema":{"type":"string","title":"Brief Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/briefs/{brief_id}/signals/{signal}/leads":{"get":{"summary":"Get Signal Leads","description":"Fetch leads for a specific signal type directly (for the workspace panel).\n\nImplements stale-while-revalidate for the jobs signal:\n- Returns cached signal_leads immediately (no blocking).\n- If the cached data is older than SIGNAL_STALE_HOURS (default 24h), spawns a\n  background refresh thread and annotates the response with cache_age_hours and\n  refreshing=True so the UI can show a \"refreshing…\" indicator.","operationId":"get_signal_leads_v1_briefs__brief_id__signals__signal__leads_get","parameters":[{"name":"brief_id","in":"path","required":true,"schema":{"type":"string","title":"Brief Id"}},{"name":"signal","in":"path","required":true,"schema":{"type":"string","title":"Signal"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":15,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/briefs/{brief_id}/feed":{"get":{"summary":"Get Brief Feed","description":"Unified feed across all 4 signals — flat list of company-grouped cards.\n\nEach card = one company + the signal that fired + decision-makers + actions.\nCards are sorted by confidence (highest first), then by detected_at.","operationId":"get_brief_feed_v1_briefs__brief_id__feed_get","parameters":[{"name":"brief_id","in":"path","required":true,"schema":{"type":"string","title":"Brief Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/briefs/{brief_id}/export.csv":{"get":{"summary":"Export Brief Csv","description":"Stream the brief's leads as a recruiter-ready CSV. Mirrors /feed but\nflattened: one row per decision-maker, so the CSV is ready to drop into a\nCRM or outbound tool.","operationId":"export_brief_csv_v1_briefs__brief_id__export_csv_get","parameters":[{"name":"brief_id","in":"path","required":true,"schema":{"type":"string","title":"Brief Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/power-search":{"post":{"summary":"Power Search","description":"Power-user passthrough: submit raw Crustdata filters, get unified cards.\n\nBody:\n  {\n    \"signal\":  \"jobs|funding|backfill|promotions\",\n    \"filters\": { Crustdata filter object — see docs.crustdata.com },\n    \"limit\":   25 (default)\n  }","operationId":"power_search_v1_power_search_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/stats":{"get":{"summary":"Admin Stats","description":"Live ops gauge for the pilot (#10 observability). Admin-token gated.\n\nAnswers \"are we burning credits / hitting limits?\" in real time:\n  - estimated Crustdata credits used since process start (NOT a billing\n    ledger or true balance — an estimate from our own call/result counts)\n  - calls per endpoint, cache hit-rate, 429 count\nHeader: X-Admin-Secret must match HONEYLEAD_ADMIN_TOKEN (or ADMIN_SECRET).","operationId":"admin_stats_v1_admin_stats_get","parameters":[{"name":"x-admin-secret","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/runs/{run_id}":{"get":{"summary":"Get Run","description":"Poll a pipeline run's status.","operationId":"get_run_v1_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/briefs/{brief_id}/events":{"get":{"summary":"Brief Events","operationId":"brief_events_v1_briefs__brief_id__events_get","parameters":[{"name":"brief_id","in":"path","required":true,"schema":{"type":"string","title":"Brief Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/mpc/parse":{"post":{"summary":"Mpc Parse","description":"Resume -> candidate profile + opportunity ICP + clarifying questions.","operationId":"mpc_parse_v1_mpc_parse_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/mpc/run":{"post":{"summary":"Mpc Run","description":"Create a candidate-sourced brief and seed all signals in the background.","operationId":"mpc_run_v1_mpc_run_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents":{"get":{"summary":"List Agents","operationId":"list_agents_v1_agents_get","parameters":[{"name":"briefId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Briefid"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}/leads":{"get":{"summary":"Leads For Agent","operationId":"leads_for_agent_v1_agents__agent_id__leads_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/leads/{lead_id}/unlock":{"post":{"summary":"Unlock Lead","description":"Reveal contact info for a signal lead.\nIf email not already in DB, fires Prospeo → Apollo waterfall.\nlead_id is the UUID from signal_leads.id.","operationId":"unlock_lead_v1_leads__lead_id__unlock_post","parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/leads/{lead_id}/draft":{"post":{"summary":"Draft Lead Outreach","description":"Generate a ready-to-send, signal-aware outreach sequence for one lead and\nreturn it inline (no chat round-trip). Reuses the same drafter the agent uses,\nso copy quality is identical. Anthropic-only — costs ZERO Crustdata credits and\ndoes NOT require the lead to be unlocked (the recruiter sends it themselves).","operationId":"draft_lead_outreach_v1_leads__lead_id__draft_post","parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}/unlock-all":{"post":{"summary":"Unlock All","description":"Reveal contacts for all leads under an agent (brief + signal).\nPhase 1: no credit deduction. agent_id = \"{brief_id}-{brand}\".","operationId":"unlock_all_v1_agents__agent_id__unlock_all_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sequences":{"get":{"summary":"List Sequences Handler","operationId":"list_sequences_handler_v1_sequences_get","parameters":[{"name":"briefId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Briefid"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sequences/{seq_id}":{"get":{"summary":"Get Sequence Handler","operationId":"get_sequence_handler_v1_sequences__seq_id__get","parameters":[{"name":"seq_id","in":"path","required":true,"schema":{"type":"string","title":"Seq Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sequences/{seq_id}/touches/{touch_id}":{"patch":{"summary":"Patch Touch","description":"Edit subject/body on a touch before it is sent.","operationId":"patch_touch_v1_sequences__seq_id__touches__touch_id__patch","parameters":[{"name":"seq_id","in":"path","required":true,"schema":{"type":"string","title":"Seq Id"}},{"name":"touch_id","in":"path","required":true,"schema":{"type":"string","title":"Touch Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/coverage/signal-cards":{"get":{"summary":"Signal Cards","operationId":"signal_cards_v1_coverage_signal_cards_get","parameters":[{"name":"briefId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Briefid"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/coverage/signals":{"get":{"summary":"Signal Coverage","description":"Return signal coverage counts for today vs week.","operationId":"signal_coverage_v1_coverage_signals_get","parameters":[{"name":"briefId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Briefid"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/coverage/pipeline":{"get":{"summary":"Pipeline Health","description":"Return pipeline health rows from recent agent_runs.","operationId":"pipeline_health_v1_coverage_pipeline_get","parameters":[{"name":"briefId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Briefid"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/quick-picks":{"get":{"summary":"Quick Picks","operationId":"quick_picks_v1_chat_quick_picks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/chat":{"post":{"summary":"Chat","description":"Batch endpoint — waits for the full agent turn, then returns JSON.","operationId":"chat_v1_chat_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/stream":{"post":{"summary":"Chat Stream","description":"Streaming endpoint — returns SSE events as the agent works.\n\nEvent types (all JSON-encoded in `data`):\n  text        — {\"text\": \"...\"}            partial assistant text\n  tool_call   — {\"name\": \"...\", \"id\": \"...\"} tool being called\n  tool_result — {\"tool_id\": \"...\", \"output\": {...}}\n  lead_block  — {\"lead\": AgentLead}         inline lead card\n  done        — {\"blocks\": [...], \"sessionId\": \"...\"}\n  error       — {\"message\": \"...\"}","operationId":"chat_stream_v1_chat_stream_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/sessions":{"get":{"summary":"List Sessions","description":"List recent chat sessions for the sidebar.","operationId":"list_sessions_v1_chat_sessions_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/chat/sessions/{session_id}":{"delete":{"summary":"Delete Chat Session","description":"Remove a session from the sidebar (soft-archive). The brief and its\nleads are untouched — this just hides the conversation thread.","operationId":"delete_chat_session_v1_chat_sessions__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Get Chat Session","description":"Load a past session's message history for display.","operationId":"get_chat_session_v1_chat_sessions__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/catalog/search":{"get":{"summary":"Search Catalog Leads","operationId":"search_catalog_leads_v1_catalog_search_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"industry","in":"query","required":false,"schema":{"type":"string","default":"","title":"Industry"}},{"name":"has_email","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Has Email"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/catalog/unlock/{lead_id}":{"post":{"summary":"Unlock Catalog Lead","description":"Reveal the email for a locked catalog lead.\n\nFires the email enrichment waterfall (Prospeo LinkedIn→email, then Apollo\nemail reveal) for a single lead on demand. Credits only burn here — not\nduring catalog population. Returns the email if found.","operationId":"unlock_catalog_lead_v1_catalog_unlock__lead_id__post","parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/catalog/stats":{"get":{"summary":"Catalog Stats","operationId":"catalog_stats_v1_catalog_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/profile/enrich":{"post":{"summary":"Enrich Profile","description":"Enrich a recruiter's LinkedIn profile via Prospeo /enrich-person.\nReturns name, title, company, and photo_url if available.\nThis is called once at profile setup; the result is cached client-side.","operationId":"enrich_profile_v1_profile_enrich_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/status":{"get":{"summary":"Billing Status","description":"Return the current user's plan, tier, and unlock counts.","operationId":"billing_status_v1_billing_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/checkout":{"post":{"summary":"Create Checkout","description":"Create a Stripe Checkout session.\nBody: { \"plan\": \"growth\" | \"scale\" }  (defaults to \"growth\")\nReturns { url } — frontend redirects to it.","operationId":"create_checkout_v1_billing_checkout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"default":{},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/portal":{"post":{"summary":"Customer Portal","description":"Return a Stripe Customer Portal URL so the user can manage/cancel.","operationId":"customer_portal_v1_billing_portal_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/team":{"get":{"summary":"Get Team","description":"Members, seat usage, owner tier, and pooled unlock usage for the caller's\nworkspace. Safe for any member to read.","operationId":"get_team_v1_team_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/team/invite":{"post":{"summary":"Invite Member","description":"Owner invites a teammate by email. Enforces the tier's seat cap and\none-pending-invite-per-email. Body: { email, role? }.","operationId":"invite_member_v1_team_invite_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/team/invite/{token}":{"get":{"summary":"Get Invite","description":"Public-ish: resolve an invite token so the accept page can show who\ninvited you and to which team. Never leaks the token itself.","operationId":"get_invite_v1_team_invite__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/team/accept":{"post":{"summary":"Accept Invite","description":"Authenticated user joins the inviting workspace as a member, inheriting\nits plan tier. The invite email must match the caller's email.","operationId":"accept_invite_v1_team_accept_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/team/invite/{invite_id}/revoke":{"post":{"summary":"Revoke Invite","description":"Owner cancels a still-pending invite.","operationId":"revoke_invite_v1_team_invite__invite_id__revoke_post","parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","title":"Invite Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/team/members/remove":{"post":{"summary":"Remove Member","description":"Owner removes a teammate. The member is moved back to their own solo\nworkspace (derived from their email) on the free tier — their account is\nnever deleted, only detached from the team.","operationId":"remove_member_v1_team_members_remove_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/onboard/analyze-website":{"post":{"summary":"Analyze Website","description":"Scrape the recruiter's agency website and return the plain-English search query\nthat describes what they place. The UI shows it for confirmation before creating a\nbrief. Returns {query, sourceUrl, scrapedChars, ok}. query is '' when the site is\ntoo thin to read — the UI then asks the recruiter directly.","operationId":"analyze_website_v1_onboard_analyze_website_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/fill-coverage":{"post":{"summary":"Fill Coverage","description":"Fill one (vertical x region) cell of the company universe from Coresignal.\nBody: {vertical, region, limit?}. Returns the stored count + a sample.","operationId":"fill_coverage_v1_admin_fill_coverage_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/test-serve":{"post":{"summary":"Test Serve","description":"Dry-run the serving path for a cell: resolve owned companies for (vertical,\nregion) and overlay Coresignal decision-makers, WITHOUT writing to the feed.\nProves the Layer-1 → Layer-2 data is good. Body: {vertical, region, companies?}.","operationId":"test_serve_v1_admin_test_serve_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/embed-companies":{"post":{"summary":"Embed Companies Ep","description":"Backfill embeddings for the owned company universe. Body: {limit?}. Run\nrepeatedly until remaining=0. No-op if embeddings are disabled.","operationId":"embed_companies_ep_v1_admin_embed_companies_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/enrich-descriptions":{"post":{"summary":"Enrich Descriptions Ep","description":"Fetch homepage meta-descriptions for the next batch of companies that lack\none (free, no API cost), so embeddings gain specialty signal. Body: {limit?}.\nRun repeatedly until remaining=0, then re-embed.","operationId":"enrich_descriptions_ep_v1_admin_enrich_descriptions_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/provider-status":{"get":{"summary":"Provider Status","description":"Confirmed live status of every provider + the owned-track readiness, so the\n'can a recruiter be spoon-fed end to end' question has a real answer. Reports\nonly whether a key is present (never the value).","operationId":"provider_status_v1_admin_provider_status_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","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"}}}}}}},"/v1/admin/test-unlock":{"post":{"summary":"Test Unlock","description":"Prove the LAST link of the spoonfeed loop: an owned-track decision-maker\n(Coresignal LinkedIn) -> verified email via the real Unlock waterfall (Blitz ->\nCrustdata -> Prospeo -> Apollo). Pass {linkedin} or let it pick a real cached\ncontact. Email is masked in the response (no raw PII).","operationId":"test_unlock_v1_admin_test_unlock_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/flag-quality":{"post":{"summary":"Flag Quality Ep","description":"Flag clearly non-US / non-company rows as `excluded` (filtered at serve time).\nBody: {dry_run?:true}. Run dry first, review samples, then {dry_run:false}.","operationId":"flag_quality_ep_v1_admin_flag_quality_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/send-digest":{"post":{"summary":"Send Digest Ep","description":"Test the morning digest. {email, workspace?, send?:false}. Default previews\nthe rendered HTML (no send); send=true emails it via Resend (no-op unless\nRESEND_API_KEY is set + the domain is verified).","operationId":"send_digest_ep_v1_admin_send_digest_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/db-stats":{"get":{"summary":"Db Stats","description":"Metadata-completeness audit of the owned company universe: how much of the\nDB has industry tags, region, headcount, embeddings, and decision-maker\ncontacts — so coverage/quality work is evidence-driven.","operationId":"db_stats_v1_admin_db_stats_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","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"}}}}}}},"/v1/admin/opps-debug":{"get":{"summary":"Opps Debug","description":"Why are the opportunities off-ICP? Shows a brief's resolved ICP target vs the\nindustry/role tag distribution of its leads, and how many survive the gate. No\nwrites. Defaults to the most-recent-with-leads brief; pass ?brief_id= to pin one.","operationId":"opps_debug_v1_admin_opps_debug_get","parameters":[{"name":"brief_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Brief Id"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","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"}}}}}}},"/v1/admin/send-tester-emails":{"post":{"summary":"Send Tester Emails","description":"Render + (optionally schedule) the pilot onboarding email to a list of testers\nvia Resend. Body: {recipients:[{email,first}], scheduled_at?, from?, reply_to?,\ndry_run?}. dry_run=true (DEFAULT) previews who/what without sending — you must pass\ndry_run=false to actually send. Excludes obvious internal accounts as a safety net.","operationId":"send_tester_emails_v1_admin_send_tester_emails_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/test-leadmagic":{"post":{"summary":"Test Leadmagic","description":"Probe LeadMagic with an arbitrary person (first/last/domain/linkedin) — used to\ntest the Huntr→LeadMagic hybrid: Huntr finds the right decision-maker, LeadMagic\nturns name+domain into the verified email. Returns (email, status).","operationId":"test_leadmagic_v1_admin_test_leadmagic_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/user-billing":{"get":{"summary":"User Billing","description":"Read a user's billing/gate state — created_at, subscription_status, trial_exempt,\nunlocks_used — to see exactly why the trial gate did or didn't fire for them.","operationId":"user_billing_v1_admin_user_billing_get","parameters":[{"name":"email","in":"query","required":false,"schema":{"type":"string","default":"","title":"Email"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","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"}}}}}}},"/v1/admin/set-trial-exempt":{"post":{"summary":"Set Trial Exempt","description":"Mark an email as trial-exempt — pilot/comp access that's NEVER paywalled by the\nfree-trial gate. Pre-creates a passwordless account if none exists yet, so a brand-new\npilot user is exempt the moment they first sign in via magic link (which finds the\nexisting record by email). Idempotent. Body: {email, name?}.","operationId":"set_trial_exempt_v1_admin_set_trial_exempt_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/test-full-brief":{"post":{"summary":"Test Full Brief","description":"END-TO-END readiness test. Parses a real NL query, creates a throwaway brief,\nand fires the FULL pre_warm pipeline (Crustdata 4 signals + Coresignal serving +\nopportunities). SPENDS Crustdata credits (~10-25 for a fresh niche). Returns the\nbrief_id immediately — poll GET /admin/opps-debug?brief_id=<id> to watch it fill.","operationId":"test_full_brief_v1_admin_test_full_brief_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/semantic-search":{"post":{"summary":"Semantic Search Ep","description":"Test the vector semantic search: embed a query and cosine-rank the owned\ncompanies. Body: {query, region?, k?}. Proves meaning-match works.","operationId":"semantic_search_ep_v1_admin_semantic_search_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/test-serve-write":{"post":{"summary":"Test Serve Write","description":"Full end-to-end validation of the accounts serving WRITE path, no recruiter\nauth needed: create a throwaway brief, run the real _seed_from_owned_companies\nagainst a synthetic ICP, read back the accounts leads (with their geo tags),\nthen delete the brief (cascade-removes the leads). Proves the CHECK-constraint\nfix, region resolution, and company-based geo tagging in one shot.\nBody: {query?, locations?, industries?}.","operationId":"test_serve_write_v1_admin_test_serve_write_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/fill-demand":{"post":{"summary":"Fill Demand Ep","description":"Run one demand-driven fill cycle now (same logic the autonomous worker uses):\nfill the thin cells recruiters actually searched, then embed. Body: {max_cells?}.","operationId":"fill_demand_ep_v1_admin_fill_demand_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/coverage":{"get":{"summary":"Coverage Status","description":"Read the coverage map + a company count — to verify a fill landed.","operationId":"coverage_status_v1_admin_coverage_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","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"}}}}}}},"/v1/opportunities":{"get":{"summary":"Get Opportunities","description":"Top ranked opportunities. Default scope = the recruiter's MOST RECENT search\n(coherent). Pass allSearches=true to aggregate across every search, or briefId to\npick one. Off-target leads are gated out in all modes.","operationId":"get_opportunities_v1_opportunities_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Limit"}},{"name":"briefId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Briefid"}},{"name":"allSearches","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Allsearches"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/mint-api-key":{"post":{"summary":"Mint Api Key","description":"Mint an API key for a workspace. {email | workspace, label?}. Admin-only.\nReturns the raw key ONCE — it is stored hashed and cannot be retrieved again.","operationId":"mint_api_key_v1_admin_mint_api_key_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api/search":{"post":{"summary":"Api Search","description":"PUBLIC (API-key) search: 'what companies in my niche are hiring right now?'\n\nAuth: `Authorization: Bearer hl_live_...`. Returns owned-data matches + which of\nthem have cached hiring signals. Never returns verified emails (account-gated).","operationId":"api_search_v1_api_search_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/mcp":{"post":{"summary":"Mcp Http","description":"Hosted MCP server (Streamable HTTP / JSON-RPC) — so recruiters can add Honeylead\nto Claude (or any MCP client) with ONE URL, no local install. Auth: pass the API\nkey via the `Authorization: Bearer hl_live_...` header (preferred) or `?key=`.\n\nAdd in Claude Code:\n  claude mcp add --transport http honeylead \\\n    https://<host>/v1/mcp --header \"Authorization: Bearer hl_live_xxx\"","operationId":"mcp_http_v1_mcp_post","parameters":[{"name":"key","in":"query","required":false,"schema":{"type":"string","default":"","title":"Key"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-keys":{"post":{"summary":"Create My Api Key","description":"Mint an API key for the signed-in user's own workspace. Returns the raw key\nONCE (stored hashed). Powers the in-app 'Settings → API' self-serve flow.","operationId":"create_my_api_key_v1_api_keys_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List My Api Keys","description":"List the signed-in user's keys (metadata only — never the raw key).","operationId":"list_my_api_keys_v1_api_keys_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-keys/{key_id}":{"delete":{"summary":"Revoke My Api Key","description":"Revoke one of the signed-in user's keys.","operationId":"revoke_my_api_key_v1_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me":{"get":{"summary":"Me","operationId":"me_v1_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/saved-searches":{"get":{"summary":"Saved Searches","operationId":"saved_searches_v1_saved_searches_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/watched-companies":{"get":{"summary":"Watched Companies","operationId":"watched_companies_v1_watched_companies_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/diagnostics":{"get":{"summary":"Diagnostics","description":"Report which API keys and DB are configured. Safe to call at any time.","operationId":"diagnostics_v1_diagnostics_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/admin/patch-session-brief":{"post":{"summary":"Patch Session Brief","description":"One-time admin fix: set agent_sessions.brief_id for an orphaned session.\nUseful when a brief was created but the linkage wasn't saved (pre-fix).","operationId":"patch_session_brief_v1_admin_patch_session_brief_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/cleanup-ta-leads":{"get":{"summary":"Cleanup Ta Leads","description":"Delete all signal_leads rows where role_title contains TA/HR terms.\nAlso delete catalog_leads rows with TA job titles.\nProtected by admin secret.","operationId":"cleanup_ta_leads_admin_cleanup_ta_leads_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/bootstrap-user":{"post":{"summary":"Bootstrap User","description":"One-time admin endpoint: create a user with a direct password hash.\nRequires bearer admin secret. Safe to call multiple times (upsert).\nRemove or gate behind feature flag after initial setup.","operationId":"bootstrap_user_v1_admin_bootstrap_user_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/preview":{"post":{"summary":"Public Preview","description":"PUBLIC no-auth instant preview — the no-signup taste (Funnel C, stage 1).\nRuns the OWNED-data semantic search only (free; no Crustdata/Coresignal, so it\nworks even with the live stack dry) and returns a redacted teaser: niche size +\ntop company names + ONE decision-maker title (name/email locked) + a drafted\nmessage. Rate-limited per IP. Contacts/emails are never returned here.","operationId":"public_preview_v1_preview_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/seed-signals/{brief_id}":{"post":{"summary":"Seed Signals","description":"Manually trigger signal seeding for a brief.\nDefault: runs the jobs worker only. With ?all_signals=true, runs ALL four\nsignals (jobs + funding + backfill + promotions) via pre_warm_brief so a\nsingle brief can be fully refreshed (each run sweeps stale leads).\nSafe to call multiple times — inserts upsert and a refresh replaces the feed.","operationId":"seed_signals_v1_seed_signals__brief_id__post","parameters":[{"name":"brief_id","in":"path","required":true,"schema":{"type":"string","title":"Brief Id"}},{"name":"all_signals","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"All Signals"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/seed-signals-all":{"post":{"summary":"Seed Signals All","description":"Run all signal workers for all live briefs — jobs, backfill, promotions, funding.\nAlso runs enricher to fill in person names for company-level rows.\nRuns in background thread. Safe to call at any time.","operationId":"seed_signals_all_v1_seed_signals_all_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/run-pipeline":{"post":{"summary":"Trigger Pipeline","operationId":"trigger_pipeline_run_pipeline_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntakePayload"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/status/{job_id}":{"get":{"summary":"Get Status","operationId":"get_status_status__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs":{"get":{"summary":"List Jobs","description":"List all jobs (admin view).","operationId":"list_jobs_jobs_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IntakePayload":{"properties":{"intake_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Intake Id"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"calendar_link":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Calendar Link"},"company_overview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Overview"},"decision_maker_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Maker Title"},"target_roles":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Roles"},"target_roles_list":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Target Roles List"},"target_locations":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Locations"},"target_headcount":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Target Headcount"},"target_revenue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Revenue"},"target_industries":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Industries"},"target_company_list":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Company List"},"excluded_companies":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Excluded Companies"},"seniority_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seniority Level"},"seniority_levels":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Seniority Levels"},"job_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Type"},"remote_preference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remote Preference"},"target_skills":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Target Skills"},"certifications":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Certifications"},"roles_to_avoid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Roles To Avoid"},"signals":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Signals"},"leads_per_month":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Leads Per Month"},"hiring_volume":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hiring Volume"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"additionalProperties":true,"type":"object","title":"IntakePayload"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}