{"openapi":"3.1.0","info":{"title":"Minro CS Platform","description":"Proactive customer success for founders","version":"0.1.0"},"paths":{"/api/v1/agents/copilot/inventory":{"get":{"tags":["agent-copilot"],"summary":"Get Inventory","description":"The workspace data inventory: what data exists here and what agent\nconfigs it can express. Every section degrades independently (carries its\nown ``error``) so one unavailable source never blanks the rest.","operationId":"get_inventory_api_v1_agents_copilot_inventory_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkspaceInventory_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/copilot/preflight":{"post":{"tags":["agent-copilot"],"summary":"Preflight","description":"Machine-run assumption checks for a not-yet-created agent config: does\nthe trigger data exist in this workspace, at what coverage, will the volume\nfit the cap, can the chosen delivery mode deliver, and what workspace rules\ninterfere. Read-only; nothing is persisted.","operationId":"preflight_api_v1_agents_copilot_preflight_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PreflightReport_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/copilot/backtest":{"post":{"tags":["agent-copilot"],"summary":"Backtest","description":"Replay a not-yet-created config over the trailing window using the live\npoll's own decision path. Read-only: the agent is never persisted, nothing\nfires. The ``notes`` field carries every honesty caveat — surface it.","operationId":"backtest_api_v1_agents_copilot_backtest_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BacktestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BacktestReport_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/copilot/chat":{"post":{"tags":["agent-copilot"],"summary":"Copilot Chat","description":"Enqueue one copilot turn as a durable Celery task and return\nimmediately. The client attaches to GET /chat/events?turn_id=... to watch\nstage updates, tool results, and the final reply arrive live. Running the\nturn outside this request means neither a slow Anthropic response nor a\nmid-turn API deploy can strand the founder with \"Build with copilot\"\nsilently frozen (see almanac/architecture/agents/agent-copilot.md). The\nonly write the loop can perform is create_agent, which is server-side\nforced to enabled=false with a non-sending delivery mode.","operationId":"copilot_chat_api_v1_agents_copilot_chat_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CopilotTurnRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/copilot/chat/events":{"get":{"tags":["agent-copilot"],"summary":"Copilot Chat Events","description":"Attach to a turn's event stream: stage labels, each tool call's result\nas it completes, then a terminal `done` (reply + events + created agent\nids) or `error` event. Safe to attach late or re-attach after a refresh —\nreplays whatever the Redis Stream still has buffered, then live-tails.","operationId":"copilot_chat_events_api_v1_agents_copilot_chat_events_get","parameters":[{"name":"turn_id","in":"query","required":true,"schema":{"type":"string","title":"Turn Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/digests":{"get":{"tags":["agent-digests"],"summary":"List Digests","operationId":"list_digests_api_v1_agents_digests_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_DigestResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["agent-digests"],"summary":"Create Digest","operationId":"create_digest_api_v1_agents_digests_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigestCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DigestResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/digests/{digest_id}":{"get":{"tags":["agent-digests"],"summary":"Get Digest","operationId":"get_digest_api_v1_agents_digests__digest_id__get","parameters":[{"name":"digest_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Digest Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DigestResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["agent-digests"],"summary":"Update Digest","operationId":"update_digest_api_v1_agents_digests__digest_id__patch","parameters":[{"name":"digest_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Digest Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigestUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DigestResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agent-digests"],"summary":"Delete Digest","operationId":"delete_digest_api_v1_agents_digests__digest_id__delete","parameters":[{"name":"digest_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Digest Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/experiments/fields":{"get":{"tags":["experiments"],"summary":"Experiment Fields","description":"What this agent's builder may offer, from the server's own allow list.\n\nThe UI reads its option set from here rather than hardcoding one, so a field can\nnever appear in the builder that the API would refuse on save.","operationId":"experiment_fields_api_v1_agents__agent_id__experiments_fields_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ExperimentFieldsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/experiments":{"get":{"tags":["experiments"],"summary":"List Experiments","description":"The agent's lineage, newest first: what was tried, what won, what got written back.","operationId":"list_experiments_api_v1_agents__agent_id__experiments_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_ExperimentListItem__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["experiments"],"summary":"Create Experiment","description":"Open a round. Starts assigning immediately.","operationId":"create_experiment_api_v1_agents__agent_id__experiments_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ExperimentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/experiments/{experiment_id}":{"get":{"tags":["experiments"],"summary":"Get Experiment","description":"The readout: per-variant aggregates, significance, and what it would take to call it.","operationId":"get_experiment_api_v1_agents__agent_id__experiments__experiment_id__get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ExperimentDetail_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/experiments/{experiment_id}/stop":{"post":{"tags":["experiments"],"summary":"Stop Experiment","description":"End the round without promoting anything.\n\nAssignment stops immediately. Runs already claimed into an arm keep their arm, still\nfire, and still adjudicate: truncating them would shrink the round's own denominator\nas a side effect of ending it, and the delayed arms would lose the most.","operationId":"stop_experiment_api_v1_agents__agent_id__experiments__experiment_id__stop_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ExperimentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/experiments/{experiment_id}/promote":{"post":{"tags":["experiments"],"summary":"Promote Variant","description":"Write the winning arm onto the agent and conclude the round.\n\nA FIELD-SCOPED write, never a config replacement: only the keys this variant actually\npatched are applied. A round can run for weeks, and an unrelated edit made to the\nagent in the meantime must not be silently reverted by promoting.","operationId":"promote_variant_api_v1_agents__agent_id__experiments__experiment_id__promote_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Experiment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ExperimentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/selection/disagreement":{"get":{"tags":["experiments"],"summary":"Get Selection Disagreement","description":"How often poll order picked something the selector would not have.\n\nTHE number shadow selection exists to produce, and the one that decides whether\ninverting the send path is worth doing. High agreement means the inversion is low value\nand the timing work matters more; low agreement means it is the most valuable thing on\nthe list. Either answer is worth having before touching a live path.\n\nSplit three ways rather than reported as one rate, because the three call for different\nresponses: a different strategy chosen is a ranking disagreement, a live send the\nselector would have declined is a message that should not have gone out, and a live\nsilence it would have broken is a missed one.","operationId":"get_selection_disagreement_api_v1_agents_selection_disagreement_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":14,"title":"Days"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/first-week/holdout":{"get":{"tags":["experiments"],"summary":"Get First Week Holdout","description":"Did the first-week ladder move the habit rate? Treated versus held out.\n\nReads the durable experiment record the state job writes onto each customer, rather\nthan recomputing the arm from the hash. Recomputing would silently re-label everyone\nthe moment the salt changed, and any drift between the two implementations would read\nas a real effect.\n\nOnly closed windows count. Someone three days past signup cannot yet have four active\ndays, so counting them draws a collapse at the right edge that makes the treated arm\nlook worse the faster it grows.\n\nExpect ``not_yet`` for a while. At ~350 signups a day and a 20% holdout, a two point\nlift needs about forty days and a one point lift is not resolvable at this volume at\nall. That is a property of the question, not a fault in the answer.","operationId":"get_first_week_holdout_api_v1_agents_first_week_holdout_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/first-week/holdout/cohorts":{"get":{"tags":["experiments"],"summary":"Get First Week Holdout Cohorts","description":"The same comparison, split by signup week, so a trend is visible rather than one\npooled figure.\n\nA single number hides the two things worth seeing: whether the gap is opening or\nclosing, and whether either arm is drifting for reasons that have nothing to do with\nthe programme (a change in acquisition mix moves both arms together, and pooling makes\nthat look like a stable effect).\n\nSame eligibility as the pooled readout, for the same reasons: durable arm labels\nrather than a recomputed hash, and closed windows only. Weeks with an empty arm are\nreturned with nulls rather than dropped, because a gap in the series is information -\nit says the holdout was not running then.","operationId":"get_first_week_holdout_cohorts_api_v1_agents_first_week_holdout_cohorts_get","parameters":[{"name":"weeks","in":"query","required":false,"schema":{"type":"integer","default":8,"title":"Weeks"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/habit/programmes":{"get":{"tags":["experiments"],"summary":"Get Habit Programmes","description":"Did the rebuild sprint bring anybody back? Enrolments and outcomes by week.\n\nGrouped on the week somebody was ENROLLED, not the week they exited, because the\nquestion is what happened to a cohort we admitted rather than what closed recently.\nGrouping on the exit date spreads one week's intake across three and makes a rate that\ncannot be reconciled with the enrolment count beside it.\n\n**An unfinished week reports ``None``, never a rate.** A sprint runs up to\n``habit_max_days``, so a week's cohort has no answer until that many days after the\nweek ends. Emitting a number early counts people who have not had the chance to come\nback yet as though they chose not to, which puts a fresh cliff on the right edge of the\nchart every single day. This is the same rule the retention cohorts use, and it is the\nmost likely way for a readout like this to mislead the person reading it.\n\n``returned`` counts every outcome that means the person came back: they graduated, they\nare on the watchlist now, they held the habit, or they relapsed later (which required\ncoming back first). ``unanswered`` is abandonment and running out of runway. A sprint\nstill running is neither.","operationId":"get_habit_programmes_api_v1_agents_habit_programmes_get","parameters":[{"name":"weeks","in":"query","required":false,"schema":{"type":"integer","default":12,"title":"Weeks"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/streak/programme":{"get":{"tags":["experiments"],"summary":"Get Streak Programme","description":"Is the streak ladder selecting anybody, and can we measure their streaks at all?\n\n**This is the shadow gate, not the causal readout.** The treated-versus-control\ncomparison for any streak agent is ``GET /agents/{agent_id}/holdout``, which runs on\nthe shared holdout service: one grouped query, one maturity clause, one outcome for\nboth arms. Recomputing arms here would be a second implementation of the same split,\nand any drift between the two would read as a real effect rather than as a bug. So\nthis answers only the two questions that are specific to this programme and that the\nrollout is blocked on.\n\n**Coverage.** ``customer_events`` is a FILTERED store: the extractor writes only events\nclassified core, minus the workspace's machine-event names, and only for workspaces\nthat opted into extraction. A server-emitted streak event can be excluded from it\nentirely, so \"the event is there\" is a measurement rather than an assumption. The split\nbelow is how many people the publisher could measure from events against how many fell\nback to the person property, which is unreliable at the exact moment the loss ladder\nfires.\n\n**Volume.** Enrolment by moment, from the currently published state, plus how often\nstreaks actually break and get rebuilt in this workspace. The break figure is\ndescriptive and explicitly NOT causal: it counts everybody, messaged or not, and exists\nto size the programme rather than to credit it.","operationId":"get_streak_programme_api_v1_agents_streak_programme_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/selection/digest":{"get":{"tags":["experiments"],"summary":"Get Selection Digest","description":"Who is being messaged, who is being skipped, and which gate skipped them.\n\nThe disagreement rate says how often poll order and the selector differ. This says\nwhat is actually happening, which is the question you have while WATCHING a rollout -\nand the one that catches a bad one. A disagreement rate can look perfectly healthy\nwhile every push in the workspace is being dropped for a single reason.\n\nRead ``skips_by_reason`` first. A spike in no_channel_token is an integration problem,\na spike in frequency_cap is a budget problem, and a spike in premise_gone means people\nare coming back on their own, which is the outcome you wanted.","operationId":"get_selection_digest_api_v1_agents_selection_digest_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/selection/gate":{"get":{"tags":["experiments"],"summary":"Get Selection Gate","description":"What is actually in force for this workspace, override and env reported separately.\n\nThey are separate on purpose: \"off because nobody turned it on\" and \"off because\nsomeone cut it during an incident\" are different situations, and a readout that\ncollapses them is useless at the moment you need it most.","operationId":"get_selection_gate_api_v1_agents_selection_gate_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["experiments"],"summary":"Set Selection Gate","description":"Turn the selector on or off for this workspace, in seconds rather than in a deploy.\n\nThis exists because arbitration CANCELS real scheduled runs and a cancelled run keeps\nits dedup slot, so the people silenced during a bad window are not recovered by the\nnext poll. A kill switch whose latency is a task-definition revision plus a service\nupdate is not a kill switch. Failures are surfaced rather than swallowed: an operator\nreaching for this has to find out immediately if it did not take.","operationId":"set_selection_gate_api_v1_agents_selection_gate_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectionGateUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/holdout/fleet":{"get":{"tags":["experiments"],"summary":"Get Holdout Fleet","description":"Every agent, its arm sizes, and whether a verdict is readable yet.\n\nA control arm nobody looks at is not a measurement, it is a slice of users receiving\nnothing in exchange for an answer no one reads. This is the page that makes the whole\nfleet's evidence visible at once.\n\nAgents with the holdout OFF are listed rather than hidden. \"We are not measuring this\none\" is the most useful row here, and filtering it out is how a fleet quietly stops\nbeing measured while the page still looks healthy.\n\nOrdered so the rows that can be acted on come first: readable, then filling by how soon\nthey will be readable, then the unmeasured ones.","operationId":"get_holdout_fleet_api_v1_agents_holdout_fleet_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/holdout":{"get":{"tags":["experiments"],"summary":"Get Agent Holdout","description":"Did this agent do anything? Treated versus its own control arm.\n\nBoth arms are counted out of one table on one maturity clause, so they report the SAME\noutcome by construction rather than by convention. The workspace's organic return rate\ntravels alongside under ``benchmark``, explicitly not causal: it compares different\npeople at different moments and an agent can beat it without having caused anything.\n\nExpect ``not_yet`` for a while, and that is the question's property rather than a fault\nin the answer. The fleet view says how long.","operationId":"get_agent_holdout_api_v1_agents__agent_id__holdout_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents":{"get":{"tags":["agents"],"summary":"List Agents","operationId":"list_agents_api_v1_agents_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_AgentResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["agents"],"summary":"Create Agent","operationId":"create_agent_api_v1_agents_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/subscription-options":{"get":{"tags":["agents"],"summary":"Subscription Options","description":"Distinct status + plan_name values (with counts) from this workspace's\nsubscription_events, so the billing-trigger builder shows real values rather than\nhardcoded guesses (a multi-company product can't assume RevenueCat vs Stripe\nstatuses). Empty when no billing data has synced yet.","operationId":"subscription_options_api_v1_agents_subscription_options_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SubscriptionOptionsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/draft-counts":{"get":{"tags":["agents"],"summary":"Agent Draft Counts","description":"True per-agent draft totals for the agents list and queue tab badges, keyed by\nagent id. The per-agent drafts LIST caps at the 500 newest rows across all statuses,\nso any count derived from it silently understates a 1000+ draft agent (the newest\nrows are mostly sent). This aggregates over everything: status counts straight from\nGROUP BY, and `safe` classified over every pending draft the same way the review\nqueue and bulk approve do (minus rows a worker is already draining), so every\nsurface shows the same number.","operationId":"agent_draft_counts_api_v1_agents_draft_counts_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_str__AgentDraftCounts__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/push-reachability":{"get":{"tags":["agents"],"summary":"Push Reachability Summary","description":"Push reachability across the recipients this workspace is actively pushing.","operationId":"push_reachability_summary_api_v1_agents_push_reachability_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PushReachabilitySummary_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}":{"get":{"tags":["agents"],"summary":"Get Agent","operationId":"get_agent_api_v1_agents__agent_id__get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["agents"],"summary":"Update Agent","operationId":"update_agent_api_v1_agents__agent_id__patch","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agents"],"summary":"Delete Agent","operationId":"delete_agent_api_v1_agents__agent_id__delete","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/redraft-all":{"post":{"tags":["agents"],"summary":"Redraft All Drafts","description":"Stream redraft progress as SSE.\n\nRuns up to 5 generate_draft calls concurrently. Each completion yields a\nJSON event. Client disconnect cancels remaining work — no Celery, no Redis.\n\nEvent shape: data: {\"draft_id\": \"...\", \"done\": N, \"total\": N, \"error\": null}\nFinal event: data: {\"done\": N, \"total\": N, \"finished\": true}","operationId":"redraft_all_drafts_api_v1_agents__agent_id__redraft_all_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/redraft-all/stop":{"post":{"tags":["agents"],"summary":"Stop Redraft All","description":"Halt an in-flight bulk-redraft: set the stop flag and revoke all queued Celery tasks\nfor the batch so tasks that haven't started yet are cancelled immediately.","operationId":"stop_redraft_all_api_v1_agents__agent_id__redraft_all_stop_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"batch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agents"],"summary":"Clear Redraft Stop","description":"Clear the redraft stop flag so a new bulk-redraft can proceed.","operationId":"clear_redraft_stop_api_v1_agents__agent_id__redraft_all_stop_delete","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/redraft-status":{"get":{"tags":["agents"],"summary":"Redraft Status","description":"Progress of a bulk-redraft cycle, computed on read from each draft's\ngeneration_context (durable, survives a browser refresh).\n\nWith ``batch_id`` omitted, reports the agent's most recent cycle — this is how the UI\nrecovers progress (or a lingering error) after a reload with no client state. A cycle\nis finished when it has members and none remain queued; ``errors`` carries the\nfailed/refused drafts so the client can render a dismissible banner.","operationId":"redraft_status_api_v1_agents__agent_id__redraft_status_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"batch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/drafts/{draft_id}/redraft":{"post":{"tags":["agents"],"summary":"Redraft Agent Draft","description":"Regenerate ONE pending agent draft in place, PRESERVING its trigger event.\n\nThe on-demand /customers/{id}/draft/generate path has no trigger event, so redrafting a\ntrigger-dependent agent (e.g. a subscription-upgrade welcome) that way strips current_tier/\nprevious_tier and the model has nothing to write from. This reuses the draft's stored\ngeneration_context (trigger_event, mode, context window) like the bulk redraft does, so a\nhealthy draft regenerates correctly. If the generator genuinely cannot write (e.g. the draft\nnever carried a trigger event), it returns 422 with the reason instead of a refusal body.","operationId":"redraft_agent_draft_api_v1_agents__agent_id__drafts__draft_id__redraft_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RedraftDraftRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DraftResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/intersections":{"get":{"tags":["agents"],"summary":"Agent Intersections","description":"Who else is talking to this agent's audience, and how often they collide.\n\nAn operator turning on a programme needs to see the overlap BEFORE choosing a group\nand a priority; without it the only feedback available is a customer receiving two\nmessages. So this uses the same window and the same claim definition the runner\narbitrates on (see services/exclusivity), and the number read here is the number the\nrunner would act on.\n\nAn agent with no group still gets a meaningful preview: the workspace default window\nis used, which is what the pair would be arbitrated with the moment somebody groups\nthem.","operationId":"agent_intersections_api_v1_agents__agent_id__intersections_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":7,"title":"Days"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentIntersectionsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/runs":{"get":{"tags":["agents"],"summary":"List Agent Runs","operationId":"list_agent_runs_api_v1_agents__agent_id__runs_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":50,"title":"Per Page"},"description":"Items per page"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedEnvelope_AgentRunResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/email-stats":{"get":{"tags":["agents"],"summary":"Agent Email Stats","description":"Open-tracking rollup for this agent's sent emails: sent / opened / open_rate.\n\n`opened` is a per-send boolean (was it opened at least once), NOT a count of opens;\nmail proxies re-fetch the pixel several times per open, so a raw fetch count would be\nmeaningless. open_rate is approximate (Gmail proxy caching, image-prefetch clients, and\nimages-off recipients all skew it); present it as directional. See app/models/email_send.py.\n\nThe matured_* fields exclude sends younger than the maturity window, whose opens\nare still arriving; show matured_open_rate, not open_rate, as the headline number.","operationId":"agent_email_stats_api_v1_agents__agent_id__email_stats_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/poll-logs":{"get":{"tags":["agents"],"summary":"List Agent Poll Logs","operationId":"list_agent_poll_logs_api_v1_agents__agent_id__poll_logs_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_AgentPollLogResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/drafts":{"get":{"tags":["agents"],"summary":"List Agent Drafts","operationId":"list_agent_drafts_api_v1_agents__agent_id__drafts_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_DraftResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/drafts/page":{"get":{"tags":["agents"],"summary":"List Agent Drafts Page","description":"Paginated, filterable, priority-sorted view of an agent's drafts for the review queue.\n\nEach draft is classified (flagged / safe / uncertain) so the UI can group, sort by who\nneeds attention, and power bulk actions — instead of the old flat 500-row, one-at-a-time\nlist. `status` filters to one of pending/sent/skipped (default: all); `q` searches the\nrecipient name/email; `sort=priority` (default) puts the highest churn-risk / revenue\nrecipients first, `sort=recent` falls back to newest-first.\n\nRecipient filters mirror the customer list (same semantics as /customers): `health`\n(repeatable, matches any), `plan_tier`, `plan_name` (repeatable; the workspace's own\nplan ladder, e.g. from /customers/group-counts?group_by=plan), `lifecycle_stage`\n(repeatable), `min_churn_risk` (inclusive) / `max_churn_risk` (exclusive), plus\n`has_bug_reports` / `has_replied` (true = at least one; via the denormalized\ncounters). Any recipient filter implicitly drops drafts whose customer row is gone,\nsince there is nothing to match against.","operationId":"list_agent_drafts_page_api_v1_agents__agent_id__drafts_page_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"priority","title":"Sort"}},{"name":"health","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Health"}},{"name":"plan_tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"}},{"name":"plan_name","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Plan Name"}},{"name":"lifecycle_stage","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Lifecycle Stage"}},{"name":"min_churn_risk","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Churn Risk"}},{"name":"max_churn_risk","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Churn Risk"}},{"name":"has_bug_reports","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Bug Reports"}},{"name":"has_replied","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Replied"}},{"name":"opened","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Opened"}},{"name":"returned","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Returned"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":50,"title":"Per Page"},"description":"Items per page"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedEnvelope_DraftResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/drafts/bulk-skip":{"post":{"tags":["agents"],"summary":"Bulk Skip Agent Drafts","description":"Skip many of an agent's PENDING drafts at once (review-queue bulk action). DB-only, so\nit's safe to run inline. Already-sent/skipped drafts and drafts from other agents are\nuntouched (the WHERE pins workspace + agent + pending). Bulk APPROVE is intentionally not\nhere — sending must go through the worker (Resend rate limits, exactly-once) and ships\nseparately.","operationId":"bulk_skip_agent_drafts_api_v1_agents__agent_id__drafts_bulk_skip_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkSkipRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BulkActionResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/drafts/skip-ungated":{"post":{"tags":["agents"],"summary":"Skip Ungated Agent Drafts","description":"Reconcile the queue to the agent's audience: skip PENDING drafts whose customer no\nlonger passes the agent's activity gate (e.g. after adding a `total_spent_cents > 0`\ngate to exclude trial-cancellers from a paid-winback).\n\nSafe by construction: skip-only, DB-only, pinned to workspace + agent + pending; an\nempty gate skips nothing. ``dry_run`` defaults TRUE — it reports who WOULD be skipped and\nwrites nothing; pass ``dry_run=false`` to actually skip. Bulk approve/send is never part\nof this path.","operationId":"skip_ungated_agent_drafts_api_v1_agents__agent_id__drafts_skip_ungated_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"dry_run","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Dry Run"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/drafts/bulk-approve":{"post":{"tags":["agents"],"summary":"Bulk Approve Agent Drafts","description":"Approve + send many of an agent's PENDING drafts. Sending must run on the worker\n(Resend's 1 req/s, exactly-once), so this ENQUEUES the sends and returns 202 with the\ncount that will be processed. `draft_ids` = explicit selection; `only_safe=true` (with no\nids) sends every 'safe'-tier pending draft and never a flagged/uncertain one, scoped to\n`filters` (same semantics as the /drafts/page recipient filters) when provided, so a\nfiltered review queue's 'Approve N safe' sends exactly the filtered set, all pages.","operationId":"bulk_approve_agent_drafts_api_v1_agents__agent_id__drafts_bulk_approve_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkApproveRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BulkActionResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/drafts/{draft_id}/send":{"post":{"tags":["agents"],"summary":"Send Agent Draft","operationId":"send_agent_draft_api_v1_agents__agent_id__drafts__draft_id__send_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"default":{},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DraftResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/drafts/{draft_id}/skip":{"patch":{"tags":["agents"],"summary":"Skip Agent Draft","operationId":"skip_agent_draft_api_v1_agents__agent_id__drafts__draft_id__skip_patch","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DraftResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/drafts/{draft_id}":{"patch":{"tags":["agents"],"summary":"Update Agent Draft","description":"Persist body/subject edits for a pending draft (autosave).","operationId":"update_agent_draft_api_v1_agents__agent_id__drafts__draft_id__patch","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DraftResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/run-now":{"post":{"tags":["agents"],"summary":"Run Agent Now","operationId":"run_agent_now_api_v1_agents__agent_id__run_now_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/dry-run":{"post":{"tags":["agents"],"summary":"Dry Run Agent","description":"Render what this agent WOULD send to specific (or sampled) real customers, with\nthe per-customer fire/suppress decision. Read-only: nothing is persisted or sent.\nPowers the \"preview against N people\" UI and the golden snapshot tests.","operationId":"dry_run_agent_api_v1_agents__agent_id__dry_run_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDryRunRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentDryRunResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/feedback-summary":{"get":{"tags":["agents"],"summary":"Agent Feedback Summary","description":"Editor signal rail: ledger counts for the CURRENT instructions version.\n\nVersion-gated by design — saving the instructions bumps the version, so the\nrail never nags about lessons already absorbed.","operationId":"agent_feedback_summary_api_v1_agents__agent_id__feedback_summary_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentFeedbackSummary_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/proposal":{"get":{"tags":["agents"],"summary":"Get Agent Proposal","description":"The agent's live mined proposals, newest first (the anti-nag budget allows\nmore than one). A proposal built against stale instructions is superseded on read\n(a manual edit landed since mining) and drops out of the list.\n\nReturns a LIST because the card shows a count: returning only the newest made the\nchip say \"2 suggested changes\" while the panel showed one, which reads as broken.","operationId":"get_agent_proposal_api_v1_agents__agent_id__proposal_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_AgentProposalResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/proposal/{proposal_id}/apply":{"post":{"tags":["agents"],"summary":"Apply Agent Proposal","description":"Apply the one-line proposal: first-decider-wins claim, versioned append\nthrough the same instruction path as a manual save, optional redraft-pending.","operationId":"apply_agent_proposal_api_v1_agents__agent_id__proposal__proposal_id__apply_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proposal Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProposalDecision"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/proposal/{proposal_id}/dismiss":{"post":{"tags":["agents"],"summary":"Dismiss Agent Proposal","description":"Dismiss: pinned by content hash — the miner won't re-derive it until enough\ngenuinely NEW signal accumulates after this decision. Idempotent-ish: a second\ndismiss of a decided proposal answers 409 with who got there first.\n\nAn optional ``reason`` is stored verbatim: it is the founder correcting the\nsystem in their own words, and it is the only record of WHY a suggestion was\nrefused. Optional on purpose — requiring it would add friction to the primary\naction, and a dismissal we don't capture is worse than one without a reason.","operationId":"dismiss_agent_proposal_api_v1_agents__agent_id__proposal__proposal_id__dismiss_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proposal Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DismissProposalRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/refine":{"post":{"tags":["agents"],"summary":"Refine Agent Instructions","description":"Suggest ONE new instruction line, with verbatim receipts. Never a rewrite.\n\nTwo callers: an 'Every draft' scoped founder note (body.note set — a declared\ncommand, converted directly), or the editor's 'Suggest an improvement' button\n(empty body — reads the recent feedback ledger for the current instructions\nversion). The write itself always happens via the versioned agent update.","operationId":"refine_agent_instructions_api_v1_agents__agent_id__refine_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRefineRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentRefineResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/preview":{"post":{"tags":["agents"],"summary":"Preview Agent","description":"Dry-run a trigger over the last N days: how many emails would this agent\nhave sent? Doubles as query validation — a broken query returns ok=False with\nthe HogQL error rather than a count.","operationId":"preview_agent_api_v1_agents_preview_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AgentPreviewResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/suggest-trigger":{"post":{"tags":["agents"],"summary":"Suggest Trigger","description":"Given a plain-English trigger description, return a matched PostHog event\nname, optional property filters, and a ready-to-store HogQL query.","operationId":"suggest_trigger_api_v1_agents_suggest_trigger_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestTriggerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SuggestTriggerResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/master/state":{"get":{"tags":["master-agent"],"summary":"Get State","operationId":"get_state_api_v1_master_state_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MasterStateResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["master-agent"],"summary":"Update State","operationId":"update_state_api_v1_master_state_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MasterStateUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MasterStateResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/master/objectives":{"get":{"tags":["master-agent"],"summary":"List Objectives","operationId":"list_objectives_api_v1_master_objectives_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_ObjectiveResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["master-agent"],"summary":"Create Objective","operationId":"create_objective_api_v1_master_objectives_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectiveCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ObjectiveResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/master/objectives/{objective_id}":{"get":{"tags":["master-agent"],"summary":"Get Objective","operationId":"get_objective_api_v1_master_objectives__objective_id__get","parameters":[{"name":"objective_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Objective Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ObjectiveResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["master-agent"],"summary":"Update Objective","operationId":"update_objective_api_v1_master_objectives__objective_id__patch","parameters":[{"name":"objective_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Objective Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectiveUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ObjectiveResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/master/messages":{"get":{"tags":["master-agent"],"summary":"List Messages","operationId":"list_messages_api_v1_master_messages_get","parameters":[{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Filter"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_MasterMessageResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/master/messages/{message_id}/respond":{"post":{"tags":["master-agent"],"summary":"Respond To Message","description":"Answer a question, decide an approval request, or acknowledge an\nescalation/report. First decider wins: the status flip is a conditional\nupdate from 'open', so two racing responders can't both decide. Approvals\nenqueue an immediate follow-up run that executes the stored action.","operationId":"respond_to_message_api_v1_master_messages__message_id__respond_post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRespondBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MasterMessageResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/master/runs":{"get":{"tags":["master-agent"],"summary":"List Runs","operationId":"list_runs_api_v1_master_runs_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_MasterRunResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/master/runs/{run_id}":{"get":{"tags":["master-agent"],"summary":"Get Run","operationId":"get_run_api_v1_master_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/master/actions":{"get":{"tags":["master-agent"],"summary":"List Actions","operationId":"list_actions_api_v1_master_actions_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_MasterActionResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/master/chat":{"post":{"tags":["master-agent"],"summary":"Master Chat","description":"Enqueue one durable master chat turn; watch it via GET /chat/events.","operationId":"master_chat_api_v1_master_chat_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MasterChatBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/master/chat/events":{"get":{"tags":["master-agent"],"summary":"Master Chat Events","operationId":"master_chat_events_api_v1_master_chat_events_get","parameters":[{"name":"turn_id","in":"query","required":true,"schema":{"type":"string","title":"Turn Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/master/tick":{"post":{"tags":["master-agent"],"summary":"Trigger Tick","description":"Manual tick (testing/ops): enqueue an immediate master turn regardless\nof the schedule. The master must be enabled.","operationId":"trigger_tick_api_v1_master_tick_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/signup":{"post":{"tags":["auth"],"summary":"Signup","operationId":"signup_api_v1_auth_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AuthResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/login":{"post":{"tags":["auth"],"summary":"Login","operationId":"login_api_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AuthResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh","operationId":"refresh_api_v1_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","operationId":"logout_api_v1_auth_logout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/account":{"delete":{"tags":["auth"],"summary":"Delete Account","description":"Hard-delete the calling user and all their workspaces from the database.","operationId":"delete_account_api_v1_auth_account_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["auth"],"summary":"Me","operationId":"me_api_v1_auth_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MeResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["auth"],"summary":"Update Me","operationId":"update_me_api_v1_auth_me_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MeResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/switch-workspace":{"post":{"tags":["auth"],"summary":"Switch Workspace","operationId":"switch_workspace_api_v1_auth_switch_workspace_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchWorkspaceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/google":{"get":{"tags":["auth"],"summary":"Google Login","description":"Redirect the browser to Google's OAuth consent screen.","operationId":"google_login_api_v1_auth_google_get","parameters":[{"name":"invite_token","in":"query","required":false,"schema":{"type":"string","title":"Invite Token"}},{"name":"mode","in":"query","required":false,"schema":{"type":"string","default":"signup","title":"Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/google/callback":{"get":{"tags":["auth"],"summary":"Google Callback","description":"Handle the OAuth callback from Google.\n\nExchanges the authorization code for user info, creates or finds the user,\nthen redirects to the frontend with a short-lived authorization code.","operationId":"google_callback_api_v1_auth_google_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/exchange":{"post":{"tags":["auth"],"summary":"Exchange Auth Code","description":"Exchange a short-lived authorization code for JWT tokens.\n\nThe code is issued during the OAuth callback redirect and is valid for 60 seconds.","operationId":"exchange_auth_code_api_v1_auth_exchange_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeExchangeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces":{"get":{"tags":["workspaces"],"summary":"List Workspaces","operationId":"list_workspaces_api_v1_workspaces_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_WorkspaceResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["workspaces"],"summary":"Create Workspace","operationId":"create_workspace_api_v1_workspaces_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkspaceResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/scoring-config":{"get":{"tags":["workspaces"],"summary":"Get Scoring Config","description":"Return the effective scoring config: saved overrides merged over defaults.","operationId":"get_scoring_config_api_v1_workspaces_scoring_config_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["workspaces"],"summary":"Update Scoring Config","description":"Save per-workspace scoring config overrides (merged over defaults).","operationId":"update_scoring_config_api_v1_workspaces_scoring_config_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoringConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/notification-prefs":{"get":{"tags":["workspaces"],"summary":"Get Notification Prefs","operationId":"get_notification_prefs_api_v1_workspaces_notification_prefs_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["workspaces"],"summary":"Update Notification Prefs","operationId":"update_notification_prefs_api_v1_workspaces_notification_prefs_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/email-rules":{"get":{"tags":["workspaces"],"summary":"Get Email Rules","description":"Return the effective email delivery rules: saved overrides merged over defaults.","operationId":"get_email_rules_api_v1_workspaces_email_rules_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["workspaces"],"summary":"Update Email Rules","description":"Save per-workspace email delivery rules (merged over defaults, validated).","operationId":"update_email_rules_api_v1_workspaces_email_rules_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/attribution/baseline":{"get":{"tags":["workspaces"],"summary":"Get Attribution Baseline","description":"The organic comeback baseline on its own, for pages that only need the line.\n\nSeparate from /attribution/summary so the Sent page and agent list don't run\nthe whole per-campaign rollup just to draw one comparison.","operationId":"get_attribution_baseline_api_v1_workspaces_attribution_baseline_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_Union_dict__NoneType__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/attribution/summary":{"get":{"tags":["workspaces"],"summary":"Get Attribution Summary","description":"Per-channel/campaign return rates, plus the baseline they should be read against.\n\nAdjudicated sends only — pending sends (window still open, or event\ncoverage lagging) are excluded from every denominator.\n\n``organic_baseline`` is the share of quiet stretches that end in a return\nwith NO message sent, computed from this workspace's own events. It is null\nwhen the workspace has no baseline yet, in which case callers must show no\ncomparison rather than inventing one: a return rate on its own cannot tell\nyou whether the message did anything.","operationId":"get_attribution_summary_api_v1_workspaces_attribution_summary_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/notification-prefs/preview":{"get":{"tags":["workspaces"],"summary":"Preview Briefing","description":"Return the assembled briefing payload without sending anything.","operationId":"preview_briefing_api_v1_workspaces_notification_prefs_preview_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/notification-prefs/send-now":{"post":{"tags":["workspaces"],"summary":"Send Briefing Now","description":"Immediately send the daily briefing email for this workspace.","operationId":"send_briefing_now_api_v1_workspaces_notification_prefs_send_now_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/notification-prefs/test-discord":{"post":{"tags":["workspaces"],"summary":"Test Discord Webhook","description":"Send a test message to the configured Discord webhook.","operationId":"test_discord_webhook_api_v1_workspaces_notification_prefs_test_discord_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/saved-views":{"get":{"tags":["workspaces"],"summary":"Get Saved Views","description":"Return the workspace-shared saved views blob ({} when never saved).","operationId":"get_saved_views_api_v1_workspaces_saved_views_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["workspaces"],"summary":"Update Saved Views","description":"Overwrite the workspace-shared saved views blob. Owned by the web client.","operationId":"update_saved_views_api_v1_workspaces_saved_views_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedViewsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/saved-views/resolve":{"post":{"tags":["workspaces"],"summary":"Resolve Saved View","description":"Resolve a saved view's filter to a real audience, server-side.\n\nUntil now a view could only be applied in the browser, over whatever customers\nwere loaded, so counts were counts of the fetched sample and no server flow\ncould target a view at all. This returns the true workspace-wide audience.\n\nSuppressed and soft-deleted customers are excluded: a resolved view is a\nsendable audience, not an analytical population. Filters that cannot be\nevaluated in SQL (industry/role buckets, PostHog event filters) are NAMED in\n`unresolvable_fields` rather than ignored — ignoring them would return a\nsuperset of what the user saw, which is the dangerous direction for a send.","operationId":"resolve_saved_view_api_v1_workspaces_saved_views_resolve_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewResolveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/analytics-ignore-list":{"get":{"tags":["workspaces"],"summary":"Get Analytics Ignore List","description":"Emails excluded from analytics/ICP/health rankings, shared across the\nworkspace ([] when never set).","operationId":"get_analytics_ignore_list_api_v1_workspaces_analytics_ignore_list_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_str__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["workspaces"],"summary":"Update Analytics Ignore List","description":"Overwrite the workspace-shared analytics ignore list. Read-modify-write on\njust this key so it never disturbs the rest of the saved-views blob.","operationId":"update_analytics_ignore_list_api_v1_workspaces_analytics_ignore_list_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsIgnoreListUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_str__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/table-prefs":{"get":{"tags":["workspaces"],"summary":"Get Table Prefs","description":"Return the workspace-shared table preferences (column order/widths/hidden).","operationId":"get_table_prefs_api_v1_workspaces_table_prefs_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["workspaces"],"summary":"Update Table Prefs","description":"Overwrite the workspace-shared table preferences. Owned by the web client.","operationId":"update_table_prefs_api_v1_workspaces_table_prefs_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TablePrefsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/{workspace_id}":{"get":{"tags":["workspaces"],"summary":"Get Workspace","operationId":"get_workspace_api_v1_workspaces__workspace_id__get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkspaceResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["workspaces"],"summary":"Update Workspace","operationId":"update_workspace_api_v1_workspaces__workspace_id__patch","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkspaceResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/{workspace_id}/members":{"get":{"tags":["workspaces"],"summary":"List Members","operationId":"list_members_api_v1_workspaces__workspace_id__members_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_MemberResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["workspaces"],"summary":"Invite Member","operationId":"invite_member_api_v1_workspaces__workspace_id__members_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberInvite"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MemberResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/{workspace_id}/members/{user_id}":{"delete":{"tags":["workspaces"],"summary":"Remove Member","operationId":"remove_member_api_v1_workspaces__workspace_id__members__user_id__delete","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers":{"get":{"tags":["customers"],"summary":"List Customers Route","operationId":"list_customers_route_api_v1_customers_get","parameters":[{"name":"health","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Health"}},{"name":"lifecycle_stage","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifecycle Stage"}},{"name":"plan_tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"}},{"name":"plan_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Name"}},{"name":"billing_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"paying | subscriber | cancelled","title":"Billing Status"},"description":"paying | subscriber | cancelled"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"created_at","title":"Sort"}},{"name":"sort_dir","in":"query","required":false,"schema":{"type":"string","default":"desc","title":"Sort Dir"}},{"name":"min_churn_risk","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Churn Risk"}},{"name":"max_churn_risk","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Churn Risk"}},{"name":"min_actions","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Actions"}},{"name":"signup_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"YYYY-MM-DD, inclusive","title":"Signup After"},"description":"YYYY-MM-DD, inclusive"},{"name":"signup_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"YYYY-MM-DD, inclusive","title":"Signup Before"},"description":"YYYY-MM-DD, inclusive"},{"name":"facet","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Facet"}},{"name":"facet_value","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Facet Value"}},{"name":"min_confidence","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Confidence"}},{"name":"paginate","in":"query","required":false,"schema":{"type":"string","description":"offset | cursor","default":"offset","title":"Paginate"},"description":"offset | cursor"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":100,"title":"Limit"}},{"name":"ph_keys","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"PostHog property keys to include","title":"Ph Keys"},"description":"PostHog property keys to include"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":50,"title":"Per Page"},"description":"Items per page"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedEnvelope_CustomerListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["customers"],"summary":"Create Customer Route","operationId":"create_customer_route_api_v1_customers_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CustomerResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/revenue-summary":{"get":{"tags":["customers"],"summary":"Revenue Summary Route","description":"Server-side revenue rollup (MRR + paying/subscriber/cancelled counts) over\nthe whole workspace, billing-source-agnostic. The Revenue page uses this\ninstead of summing a client-loaded page, so the numbers match the Overview's\nserver aggregate at any scale.","operationId":"revenue_summary_route_api_v1_customers_revenue_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RevenueSummaryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/enrichment-stats":{"get":{"tags":["customers"],"summary":"Enrichment Stats Route","operationId":"enrichment_stats_route_api_v1_customers_enrichment_stats_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EnrichmentStats_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/facets":{"get":{"tags":["customers"],"summary":"Customer Facets Route","description":"Workspace-wide ICP breakdown counts per dimension, computed server-side\nover enriched customers (replaces the loaded-sample client grouping).","operationId":"customer_facets_route_api_v1_customers_facets_get","parameters":[{"name":"dims","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated dimension ids","title":"Dims"},"description":"Comma-separated dimension ids"},{"name":"min_confidence","in":"query","required":false,"schema":{"type":"number","maximum":100,"minimum":0,"default":0.0,"title":"Min Confidence"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_str__list_dict___"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/group-counts":{"get":{"tags":["customers"],"summary":"Customer Group Counts Route","description":"Per-group row counts for the grouped Users view's section headers,\nhonouring the active filters (search / health / plan / churn). Each group's\nrows are fetched separately via the cursor list.","operationId":"customer_group_counts_route_api_v1_customers_group_counts_get","parameters":[{"name":"group_by","in":"query","required":true,"schema":{"type":"string","description":"plan | health | lifecycle","title":"Group By"},"description":"plan | health | lifecycle"},{"name":"health","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Health"}},{"name":"plan_tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"}},{"name":"lifecycle_stage","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifecycle Stage"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"min_churn_risk","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Churn Risk"}},{"name":"max_churn_risk","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Churn Risk"}},{"name":"min_actions","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Actions"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/enrichment-runs":{"get":{"tags":["customers"],"summary":"List Enrichment Runs","operationId":"list_enrichment_runs_api_v1_customers_enrichment_runs_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/enrichment-status":{"get":{"tags":["customers"],"summary":"Enrichment Status","operationId":"enrichment_status_api_v1_customers_enrichment_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_Union_dict__NoneType__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}":{"get":{"tags":["customers"],"summary":"Get Customer Route","operationId":"get_customer_route_api_v1_customers__customer_id__get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CustomerResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["customers"],"summary":"Update Customer Route","operationId":"update_customer_route_api_v1_customers__customer_id__patch","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CustomerResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["customers"],"summary":"Delete Customer Route","operationId":"delete_customer_route_api_v1_customers__customer_id__delete","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/import":{"post":{"tags":["customers"],"summary":"Import Customers Route","operationId":"import_customers_route_api_v1_customers_import_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_customers_route_api_v1_customers_import_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CustomerImportResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/import/preview":{"post":{"tags":["customers"],"summary":"Import Preview Route","description":"Match uploaded emails against the PostHog pool and preview the import.","operationId":"import_preview_route_api_v1_customers_import_preview_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailMatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EmailMatchPreview_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/import/allowlist":{"post":{"tags":["customers"],"summary":"Import Allowlist Route","description":"Import the matched emails returned by the preview step.\n\nTrusts the supplied (already-matched) set, so PostHog is not re-queried.","operationId":"import_allowlist_route_api_v1_customers_import_allowlist_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailMatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CustomerImportResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/churn-risk-history":{"get":{"tags":["customers"],"summary":"Customer Churn Risk History Route","operationId":"customer_churn_risk_history_route_api_v1_customers__customer_id__churn_risk_history_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/timeline":{"get":{"tags":["customers"],"summary":"Customer Timeline Route","operationId":"customer_timeline_route_api_v1_customers__customer_id__timeline_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/usage":{"get":{"tags":["customers"],"summary":"Customer Usage Route","description":"How this person used the product: their flow, session by session.\n\nReads our own event store rather than PostHog, so this is a handful of\nindexed selects and stays inside the profile's load budget. The two\nworkspace-level comparisons it draws on (the per-event baseline and the\ndominant path) are precomputed snapshots; when they are missing the tab drops\nthe comparison and shows the flow, rather than blocking on a scan.","operationId":"customer_usage_route_api_v1_customers__customer_id__usage_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":180,"minimum":7,"default":90,"title":"Days"}},{"name":"sessions","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":4,"title":"Sessions"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/posthog-events/search":{"get":{"tags":["customers"],"summary":"Customer Posthog Event Search Route","operationId":"customer_posthog_event_search_route_api_v1_customers__customer_id__posthog_events_search_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":1,"default":"","title":"Q"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_str__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/posthog-events":{"get":{"tags":["customers"],"summary":"Customer Posthog Events Route","operationId":"customer_posthog_events_route_api_v1_customers__customer_id__posthog_events_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":25,"title":"Limit"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"event","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/draft":{"get":{"tags":["customers"],"summary":"Get Customer Draft","description":"The draft waiting for this person. ``channel`` narrows it to one channel.\n\nA profile holds at most one pending draft per channel, so the email view and\nthe push view have to ask for their own; unfiltered (the historical default)\nstill returns whichever is newest.\n\n``include_agent_drafts=false`` leaves an agent's queued draft where it\nbelongs — in that agent's review queue, behind that agent's own gates.","operationId":"get_customer_draft_api_v1_customers__customer_id__draft_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"}},{"name":"include_agent_drafts","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Agent Drafts"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_Union_DraftResponse__NoneType__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/draft/generate":{"post":{"tags":["customers"],"summary":"Generate Customer Draft","operationId":"generate_customer_draft_api_v1_customers__customer_id__draft_generate_post","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DraftGenerateRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DraftResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/draft/{draft_id}/send":{"post":{"tags":["customers"],"summary":"Send Draft","operationId":"send_draft_api_v1_customers__customer_id__draft__draft_id__send_post","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftSendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DraftResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/draft/{draft_id}/send-push":{"post":{"tags":["customers"],"summary":"Send Draft As Push","description":"Actually send one push, from this person's profile, right now.\n\nDeliberately NOT the sibling ``/send`` route: that one only calls\nmark_draft_sent, because it records a message the founder already sent by\nhand in Gmail. Pointing a push at it would flip the draft to 'sent' while no\nphone ever buzzed.\n\nRouted through the one-off dispatcher instead, so a hand-sent push gets the\nsame treatment as every other push we send: the per-recipient frequency cap,\nthe push judge, the atomic pending -> sent claim that makes it exactly-once,\nand the outreach record that return attribution reads. ``override_hold``\nskips the judge and nothing else, and is written onto the draft.\n\nRuns inline rather than queued: someone sending one message wants to be told\nit was held, not to find out later.","operationId":"send_draft_as_push_api_v1_customers__customer_id__draft__draft_id__send_push_post","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/outreach":{"get":{"tags":["customers"],"summary":"List Customer Outreach","operationId":"list_customer_outreach_api_v1_customers__customer_id__outreach_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_OutreachHistoryResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/outreach/sent":{"get":{"tags":["customers"],"summary":"List Sent Emails","operationId":"list_sent_emails_api_v1_customers_outreach_sent_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":100,"title":"Per Page"}},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Scope to one agent/campaign's sends (its campaign_id).","title":"Campaign Id"},"description":"Scope to one agent/campaign's sends (its campaign_id)."},{"name":"direct","in":"query","required":false,"schema":{"type":"boolean","description":"Scope to direct sends only (rows with no campaign).","default":false,"title":"Direct"},"description":"Scope to direct sends only (rows with no campaign)."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedEnvelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/outreach/sent/groups":{"get":{"tags":["customers"],"summary":"List Sent Email Groups","description":"Accurate per-agent (campaign) roll-up for the Sent page headers.\n\nGrouped over OutreachHistory (the same source the list reads), so each header's\n\"N sent\" is the true total for that agent — never a slice of a fetched window.\nOpen-rate columns come from the left-joined EmailSend rows, matured on sent_at\nexactly like /outreach/stats. campaign_id NULL => the \"Direct sends\" group.","operationId":"list_sent_email_groups_api_v1_customers_outreach_sent_groups_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/outreach/stats":{"get":{"tags":["customers"],"summary":"Get Outreach Stats","operationId":"get_outreach_stats_api_v1_customers_outreach_stats_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/outreach/unsubscribed":{"get":{"tags":["customers"],"summary":"List Unsubscribed Recipients","description":"Who is on the suppression list: the people behind the sent-view's \"Unsubscribed\"\ncount. Joined to customers by address for a display name; someone who unsubscribed\nbut was never imported still appears (email only). Newest first.","operationId":"list_unsubscribed_recipients_api_v1_customers_outreach_unsubscribed_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/outreach/{outreach_id}/content":{"get":{"tags":["customers"],"summary":"Get Sent Email Content","description":"Full contents of one sent email, fetched lazily when a row is expanded.\n\nThe list endpoint only carries content_preview (the outreach row's truncated\ncopy). The full body lives on the owning draft; direct sends without a draft\nfall back to the preview (is_full=False so the UI can say so).","operationId":"get_sent_email_content_api_v1_customers_outreach__outreach_id__content_get","parameters":[{"name":"outreach_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Outreach Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/communications":{"get":{"tags":["customers"],"summary":"List Customer Communications","description":"Everything exchanged with this customer, newest first: real emails across the\nconnected inboxes plus Minro-sent drafts (agent and manual sends over any\ntransport). Gmail-synced mail and SES inbound come from gmail_messages; ESP and\npush sends only exist as sent drafts, so an ESP-only workspace would show an\nempty history without them.","operationId":"list_customer_communications_api_v1_customers__customer_id__communications_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_CommunicationItem__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/enrich":{"post":{"tags":["customers"],"summary":"Enrich Customer Route","operationId":"enrich_customer_route_api_v1_customers__customer_id__enrich_post","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CustomerResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/draft/{draft_id}/skip":{"post":{"tags":["customers"],"summary":"Skip Draft Route","operationId":"skip_draft_route_api_v1_customers__customer_id__draft__draft_id__skip_post","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DraftResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/draft/rewrite":{"post":{"tags":["customers"],"summary":"Rewrite Draft Route","description":"Rewrite the current draft body using a user-supplied instruction.","operationId":"rewrite_draft_route_api_v1_customers__customer_id__draft_rewrite_post","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftRewriteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/draft/{draft_id}":{"patch":{"tags":["customers"],"summary":"Update Draft Route","operationId":"update_draft_route_api_v1_customers__customer_id__draft__draft_id__patch","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DraftResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/observations":{"get":{"tags":["customers"],"summary":"Get Observations Route","operationId":"get_observations_route_api_v1_customers__customer_id__observations_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/observations/generate":{"post":{"tags":["customers"],"summary":"Generate Observations Route","operationId":"generate_observations_route_api_v1_customers__customer_id__observations_generate_post","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/stripe-sync":{"post":{"tags":["customers"],"summary":"Stripe Sync Customer","operationId":"stripe_sync_customer_api_v1_customers__customer_id__stripe_sync_post","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CustomerResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/stripe-invoices":{"get":{"tags":["customers"],"summary":"Stripe Invoices Customer","operationId":"stripe_invoices_customer_api_v1_customers__customer_id__stripe_invoices_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/revenuecat-events":{"get":{"tags":["customers"],"summary":"Revenuecat Events Customer","description":"Per-customer subscription lifecycle for RevenueCat customers.\n\nBuilt from the source-agnostic ``subscription_events`` log (one row per\nuser+product) rather than a live API call, so it gives RevenueCat customers\nthe same Revenue-tab timeline Stripe customers get from their invoices.\nReturns events newest-first in the same shape the Revenue tab renders:\na \"subscription_created\" per subscription and a \"cancellation\" if it ended.","operationId":"revenuecat_events_customer_api_v1_customers__customer_id__revenuecat_events_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/enrich-all":{"post":{"tags":["customers"],"summary":"Enrich All Customers Route","operationId":"enrich_all_customers_route_api_v1_customers_enrich_all_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customers/{customer_id}/activity-strip":{"get":{"tags":["customers"],"summary":"Customer Activity Strip","description":"One customer's last two weeks, split into the workspace's activity modes.\n\nThe same strip the \"most engaged\" card draws, for whichever customer you\nopened. The profile already had a 14-day activity chart, but it plots a\nsingle undifferentiated count, and volume is the half of the picture that\nbarely distinguishes anyone: measured on Parrot the top users are active 16\nto 30 days out of 30, so height alone is nearly flat across all of them.\nWhat separates them is *what* they did, which is what the modes colour in.\n\nReads ``customer_events``, filled by the event-extract job, so this costs one\nindexed range scan and no PostHog call. A workspace with no configured modes\nstill gets the strip as a single unnamed series, which keeps the trend and\nthe gaps.\n\nWhen the trailing fortnight is empty the window slides back to end on the\ncustomer's last active day (``window_mode: \"historical\"``). Fourteen blank\ncolumns are honest but throw away the case most worth reading: someone who\nchurned has a story in the run-up to going quiet, and a strictly trailing\nwindow can never show it. A customer with no events at all has no such\nfortnight and keeps the empty state, because \"churned long ago\" and \"never\nstarted\" are different facts and must not render the same.","operationId":"customer_activity_strip_api_v1_customers__customer_id__activity_strip_get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facts/digest":{"get":{"tags":["facts"],"summary":"Facts Digest","description":"The everyday ledger: facts created/updated in the last `since_hours` across all\ncustomers, most-recent first, with per-type counts.","operationId":"facts_digest_api_v1_facts_digest_get","parameters":[{"name":"since_hours","in":"query","required":false,"schema":{"type":"integer","maximum":720,"minimum":1,"default":24,"title":"Since Hours"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DigestData_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facts/customers/{customer_id}":{"get":{"tags":["facts"],"summary":"Customer Facts","description":"One customer's ledger, most-recent first. `status` filters active/resolved/dismissed/all.","operationId":"customer_facts_api_v1_facts_customers__customer_id__get","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"active","title":"Status"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CustomerFactsData_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facts/{fact_id}/status":{"post":{"tags":["facts"],"summary":"Set Fact Status","description":"Light triage: mark a fact resolved/dismissed (or re-activate). Workspace-scoped.","operationId":"set_fact_status_api_v1_facts__fact_id__status_post","parameters":[{"name":"fact_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Fact Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactStatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FactOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/direct-sends/preview":{"post":{"tags":["direct-sends"],"summary":"Preview Audience","description":"Who this would reach, before anything is written or spent.","operationId":"preview_audience_api_v1_direct_sends_preview_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudiencePreview"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/direct-sends/senders":{"get":{"tags":["direct-sends"],"summary":"List Senders","description":"The identities a one-off can go out as, and which one to start on.","operationId":"list_senders_api_v1_direct_sends_senders_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/direct-sends":{"post":{"tags":["direct-sends"],"summary":"Create Direct Send","description":"Record the intent and pin down the audience size. Writes no drafts.","operationId":"create_direct_send_api_v1_direct_sends_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectSendCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["direct-sends"],"summary":"List Direct Sends","description":"The audit list: every one-off composed in this workspace, newest first.","operationId":"list_direct_sends_api_v1_direct_sends_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/direct-sends/{direct_send_id}/generate":{"post":{"tags":["direct-sends"],"summary":"Generate Direct Send","description":"Write one draft per recipient. They land in review; nothing is sent here.\n\nThe audience is re-resolved at generation time rather than reusing the count\nfrom creation: somebody may have unsubscribed in between, and the opt-out has\nto win.","operationId":"generate_direct_send_api_v1_direct_sends__direct_send_id__generate_post","parameters":[{"name":"direct_send_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Direct Send Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/direct-sends/{direct_send_id}/drafts":{"get":{"tags":["direct-sends"],"summary":"List Direct Send Drafts","description":"The batch's drafts, for review before sending.\n\nCarries each draft's judge verdict so the reviewer sees what the same judge\nthat gates agent sends thought of this copy, rather than reading 200 drafts\nwith no signal about which ones need attention.","operationId":"list_direct_send_drafts_api_v1_direct_sends__direct_send_id__drafts_get","parameters":[{"name":"direct_send_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Direct Send Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/direct-sends/{direct_send_id}/drafts/{draft_id}/send":{"post":{"tags":["direct-sends"],"summary":"Send One From Batch","description":"Send ONE draft from this batch, now.\n\nDeliberately routed through the batch's own dispatcher rather than either\nexisting per-draft send. The agent route needs an agent to take identity and\ngates from, and the customer route only calls mark_draft_sent — it records a\nsend someone performed by hand in Gmail, so pointing this at it would flip\ndrafts to 'sent' while transmitting nothing.\n\nRuns inline rather than queued: a founder sending one message wants to be\ntold it was held by the judge, not to discover it later in the queue.","operationId":"send_one_from_batch_api_v1_direct_sends__direct_send_id__drafts__draft_id__send_post","parameters":[{"name":"direct_send_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Direct Send Id"}},{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/direct-sends/{direct_send_id}/send-all":{"post":{"tags":["direct-sends"],"summary":"Send All Direct Send","description":"Send every draft in this batch that is still pending.\n\nHands off to a worker that paces deliveries one per second, so the request\nreturns immediately and a 200-recipient batch cannot burst past the ESP's\nrate limit. Each delivery re-checks suppression and the frequency cap on its\nown; approving here is not a licence to skip those. The content judge is the\none thing ``override_hold`` can waive, because a person read the copy.","operationId":"send_all_direct_send_api_v1_direct_sends__direct_send_id__send_all_post","parameters":[{"name":"direct_send_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Direct Send Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/direct-sends/{direct_send_id}":{"get":{"tags":["direct-sends"],"summary":"Get One Direct Send","description":"One batch plus where its drafts currently stand.","operationId":"get_one_direct_send_api_v1_direct_sends__direct_send_id__get","parameters":[{"name":"direct_send_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Direct Send Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/escalations":{"get":{"tags":["escalations"],"summary":"List Escalations","description":"Open client-owned escalations: the drafted reply is still pending and awaiting the\nfounder's call. Most-recent first.","operationId":"list_escalations_api_v1_escalations_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_EscalationOut__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/escalations/{draft_id}/dismiss":{"post":{"tags":["escalations"],"summary":"Dismiss Escalation","description":"Founder's call: don't send this. Marks the draft skipped and the escalation resolved.","operationId":"dismiss_escalation_api_v1_escalations__draft_id__dismiss_post","parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/escalations/{draft_id}/approve":{"post":{"tags":["escalations"],"summary":"Approve Escalation","description":"Founder's call: send the drafted reply as-is. Routes by draft mode (follow-up reply vs\nagent send), then marks the escalation resolved. The underlying send paths still enforce\nsuppression + the send guard.","operationId":"approve_escalation_api_v1_escalations__draft_id__approve_post","parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/context/items":{"get":{"tags":["context"],"summary":"List Items","operationId":"list_items_api_v1_context_items_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["context"],"summary":"Create Item","operationId":"create_item_api_v1_context_items_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextItemIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/context/items/{item_id}":{"patch":{"tags":["context"],"summary":"Update Item","operationId":"update_item_api_v1_context_items__item_id__patch","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextItemPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["context"],"summary":"Delete Item","operationId":"delete_item_api_v1_context_items__item_id__delete","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/context/revisions":{"get":{"tags":["context"],"summary":"List Revisions","description":"Recent context changes, newest first — the 'Recent changes' feed.","operationId":"list_revisions_api_v1_context_revisions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/drafts/{draft_id}/trace":{"get":{"tags":["drafts"],"summary":"Get Draft Trace","description":"Provenance of the LATEST generation of this draft: the exact context,\ninstructions, voice, and documents that produced the current subject/body.\n404 when the draft has no trace (template-mode copy, or generated before\ntracing shipped) — the UI hides the affordance in that case.","operationId":"get_draft_trace_api_v1_drafts__draft_id__trace_get","parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents":{"get":{"tags":["documents"],"summary":"List Documents","operationId":"list_documents_api_v1_documents_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["documents"],"summary":"Upload Document","operationId":"upload_document_api_v1_documents_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document_api_v1_documents_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/text":{"post":{"tags":["documents"],"summary":"Add Text Document","description":"Save pasted text (positioning notes, FAQ answers, promo details) as a document.","operationId":"add_text_document_api_v1_documents_text_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextDocumentIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/url":{"post":{"tags":["documents"],"summary":"Add Url Document","description":"Fetch a docs/FAQ/changelog page once and store its text as a document.","operationId":"add_url_document_api_v1_documents_url_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlDocumentIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/{document_id}":{"get":{"tags":["documents"],"summary":"Get Document","description":"Full document including the stored extracted text (what drafts are grounded in).","operationId":"get_document_api_v1_documents__document_id__get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["documents"],"summary":"Delete Document","operationId":"delete_document_api_v1_documents__document_id__delete","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/today":{"get":{"tags":["today"],"summary":"Get Today","operationId":"get_today_api_v1_today_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/today/refresh":{"post":{"tags":["today"],"summary":"Refresh Today","operationId":"refresh_today_api_v1_today_refresh_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/health/summary":{"get":{"tags":["health"],"summary":"Health Summary","operationId":"health_summary_api_v1_health_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_HealthSummary_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/health/changes":{"get":{"tags":["health"],"summary":"Health Changes","operationId":"health_changes_api_v1_health_changes_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/health/churn-distribution":{"get":{"tags":["health"],"summary":"Churn Distribution","operationId":"churn_distribution_api_v1_health_churn_distribution_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ChurnDistribution_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/health/mrr-timeline":{"get":{"tags":["health"],"summary":"Mrr Timeline","operationId":"mrr_timeline_api_v1_health_mrr_timeline_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MrrTimeline_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/health/unmatched-stripe-subscribers":{"get":{"tags":["health"],"summary":"Unmatched Stripe Subscribers","description":"Stripe subscriber emails with no matching Minro customer, keyed by best status.\n\nReturns one row per email. Each row includes the most recent subscription's\nstatus, mrr_cents, and whether it was cancelled (has_cancellation).","operationId":"unmatched_stripe_subscribers_api_v1_health_unmatched_stripe_subscribers_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/lifecycle/summary":{"get":{"tags":["health"],"summary":"Lifecycle Summary","operationId":"lifecycle_summary_api_v1_lifecycle_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LifecycleSummary_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/health/metrics/{kind}":{"get":{"tags":["health"],"summary":"Metric Snapshot Read","description":"One indexed select. Always reports the payload's age and whether the last\nrefresh failed, so a stale answer can never be mistaken for a fresh one.","operationId":"metric_snapshot_read_api_v1_health_metrics__kind__get","parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","title":"Kind"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/health/metrics/{kind}/refresh":{"post":{"tags":["health"],"summary":"Metric Snapshot Refresh","description":"Ask for an out-of-band recompute.\n\nReturns immediately: the work is a multi-second PostHog scan and must not\nhappen inside a request. A refresh already in flight is not started again,\nsince the job claims the row before scanning.","operationId":"metric_snapshot_refresh_api_v1_health_metrics__kind__refresh_post","parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","title":"Kind"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/health/renewal-calendar":{"get":{"tags":["health"],"summary":"Renewal Calendar","description":"What each month ahead brings in, split by who has already cancelled.\n\nPure Postgres over subscription_events, so unlike the cohort charts this needs\nno snapshot: it is a grouped read of a few thousand rows on an indexed column,\nnot a scan of a year of analytics events.\n\nReplaces MRR as the headline for subscription-heavy workspaces. MRR smooths an\nannual plan into twelve equal slices, which hides the thing an annual-majority\nbusiness most needs to see: on Parrot, 3,015 subscriptions fall due in one\nmonth and a smooth line shows no cliff there at all.","operationId":"renewal_calendar_api_v1_health_renewal_calendar_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bugs":{"get":{"tags":["bugs"],"summary":"List Bugs Route","operationId":"list_bugs_route_api_v1_bugs_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":50,"title":"Per Page"},"description":"Items per page"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedEnvelope_BugResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["bugs"],"summary":"Create Bug Route","operationId":"create_bug_route_api_v1_bugs_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BugCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BugResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bugs/{bug_id}":{"patch":{"tags":["bugs"],"summary":"Update Bug Route","operationId":"update_bug_route_api_v1_bugs__bug_id__patch","parameters":[{"name":"bug_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Bug Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BugUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BugResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bugs/{bug_id}/file":{"post":{"tags":["bugs"],"summary":"File Bug Route","operationId":"file_bug_route_api_v1_bugs__bug_id__file_post","parameters":[{"name":"bug_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Bug Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/BugFileRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BugFileResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bugs/{bug_id}/dismiss":{"post":{"tags":["bugs"],"summary":"Dismiss Bug Route","operationId":"dismiss_bug_route_api_v1_bugs__bug_id__dismiss_post","parameters":[{"name":"bug_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Bug Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BugResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bugs/{bug_id}/restore":{"post":{"tags":["bugs"],"summary":"Restore Bug Route","operationId":"restore_bug_route_api_v1_bugs__bug_id__restore_post","parameters":[{"name":"bug_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Bug Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BugResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/follow-ups":{"get":{"tags":["follow-ups"],"summary":"List Follow Ups","operationId":"list_follow_ups_api_v1_follow_ups_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","pattern":"^(open|dismissed|responded|all)$","default":"open","title":"Status"}},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Only threads opened by this agent. Unattributed threads (no send of ours referenced) are excluded, which is the point: an agent's queue should not contain cold inbound.","title":"Agent Id"},"description":"Only threads opened by this agent. Unattributed threads (no send of ours referenced) are excluded, which is the point: an agent's queue should not contain cold inbound."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FollowUpList_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/follow-ups/{message_id}/dismiss":{"post":{"tags":["follow-ups"],"summary":"Dismiss Follow Up","operationId":"dismiss_follow_up_api_v1_follow_ups__message_id__dismiss_post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/follow-ups/{message_id}/restore":{"post":{"tags":["follow-ups"],"summary":"Restore Follow Up","operationId":"restore_follow_up_api_v1_follow_ups__message_id__restore_post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/follow-ups/{message_id}/draft":{"post":{"tags":["follow-ups"],"summary":"Draft Follow Up Reply","description":"AI reply draft for a follow-up (on-demand generate/regenerate; most items are\npre-drafted by the post-analysis job). The generated Draft carries the Gmail thread\nid so a reply sent from it participates in reply tracking (reply_received).","operationId":"draft_follow_up_reply_api_v1_follow_ups__message_id__draft_post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FollowUpDraftResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/follow-ups/{message_id}/reply":{"post":{"tags":["follow-ups"],"summary":"Send Follow Up Reply","description":"Reply to a follow-up without Gmail, over the chosen transport:\n\n- \"domain\" (default): SES from the workspace's verified receiving domain, with\n  full threading headers, so it lands in the customer's existing thread and\n  their next reply attributes back by header.\n- \"resend\": the workspace's Resend identity, threading headers included\n  (Resend passes them through).\n- \"autosend\": the workspace's AutoSend identity. AutoSend reserves the\n  threading headers, so the reply arrives as a \"Re:\" without hard threading;\n  attribution of the next customer reply falls back to the subject match.\n\nThe outbound copy is echoed into the message store, which moves the item to\nResponded. When draft_id is given, the (possibly edited) body is saved back\nonto the draft before it's marked sent.","operationId":"send_follow_up_reply_api_v1_follow_ups__message_id__reply_post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpReplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbound-domain":{"get":{"tags":["inbound-domain"],"summary":"Get Inbound Domain","operationId":"get_inbound_domain_api_v1_inbound_domain_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_InboundDomainState_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["inbound-domain"],"summary":"Create Inbound Domain","operationId":"create_inbound_domain_api_v1_inbound_domain_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundDomainCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_InboundDomainState_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["inbound-domain"],"summary":"Delete Inbound Domain","operationId":"delete_inbound_domain_api_v1_inbound_domain_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbound-domain/ack":{"post":{"tags":["inbound-domain"],"summary":"Acknowledge Activation","description":"Dismiss the one-time \"DNS verified\" banner. Backend-stored (not browser\nstate) so the confirmation shows exactly once, on whatever device the\nfounder opens next.","operationId":"acknowledge_activation_api_v1_inbound_domain_ack_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls/resync":{"post":{"tags":["calls"],"summary":"Resync Calls","description":"Kick off a Cal.com booking sync for the current workspace.\n\nReturns 202 immediately; the sync runs on Celery. The frontend refetches\n/calls/summary after a short delay to show the fresh data.","operationId":"resync_calls_api_v1_calls_resync_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls/summary":{"get":{"tags":["calls"],"summary":"Calls Summary","description":"Dashboard payload: totals, 30-day time series, segment breakdown, spend,\nrecent bookings.","operationId":"calls_summary_api_v1_calls_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls/bookings":{"get":{"tags":["calls"],"summary":"List Bookings","description":"Full paginated list, for a future 'all bookings' view.","operationId":"list_bookings_api_v1_calls_bookings_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cohorts":{"get":{"tags":["cohorts"],"summary":"List Cohorts","operationId":"list_cohorts_api_v1_cohorts_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":50,"title":"Per Page"},"description":"Items per page"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedEnvelope_CohortResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["cohorts"],"summary":"Create Cohort","operationId":"create_cohort_api_v1_cohorts_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CohortCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CohortResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cohorts/{cohort_id}":{"get":{"tags":["cohorts"],"summary":"Get Cohort","operationId":"get_cohort_api_v1_cohorts__cohort_id__get","parameters":[{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cohort Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CohortResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["cohorts"],"summary":"Update Cohort","operationId":"update_cohort_api_v1_cohorts__cohort_id__patch","parameters":[{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cohort Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CohortUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CohortResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["cohorts"],"summary":"Delete Cohort","operationId":"delete_cohort_api_v1_cohorts__cohort_id__delete","parameters":[{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cohort Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cohorts/{cohort_id}/customers":{"get":{"tags":["cohorts"],"summary":"Cohort Customers","operationId":"cohort_customers_api_v1_cohorts__cohort_id__customers_get","parameters":[{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cohort Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":50,"title":"Per Page"},"description":"Items per page"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedEnvelope_CustomerListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cohorts/{cohort_id}/export":{"post":{"tags":["cohorts"],"summary":"Export Cohort","operationId":"export_cohort_api_v1_cohorts__cohort_id__export_post","parameters":[{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cohort Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/icp/top-users":{"get":{"tags":["icp"],"summary":"Top Users","operationId":"top_users_api_v1_icp_top_users_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_TopUser__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/icp/patterns":{"get":{"tags":["icp"],"summary":"Icp Patterns","description":"Pattern synthesis runs weekly as a background job. This endpoint returns\nthe last computed patterns. In production, the patterns are generated by\nan LLM analyzing structured customer data.","operationId":"icp_patterns_api_v1_icp_patterns_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_ICPPattern__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/icp/summary":{"get":{"tags":["icp"],"summary":"Icp Summary","operationId":"icp_summary_api_v1_icp_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ICPSummary_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cohorts/{cohort_id}/widgets":{"get":{"tags":["insights"],"summary":"List Widgets","operationId":"list_widgets_api_v1_cohorts__cohort_id__widgets_get","parameters":[{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cohort Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_WidgetResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["insights"],"summary":"Create Widget","operationId":"create_widget_api_v1_cohorts__cohort_id__widgets_post","parameters":[{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cohort Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WidgetResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cohorts/{cohort_id}/widgets/{widget_id}":{"get":{"tags":["insights"],"summary":"Get Widget","operationId":"get_widget_api_v1_cohorts__cohort_id__widgets__widget_id__get","parameters":[{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cohort Id"}},{"name":"widget_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Widget Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WidgetResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["insights"],"summary":"Update Widget","operationId":"update_widget_api_v1_cohorts__cohort_id__widgets__widget_id__patch","parameters":[{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cohort Id"}},{"name":"widget_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Widget Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WidgetResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["insights"],"summary":"Delete Widget","operationId":"delete_widget_api_v1_cohorts__cohort_id__widgets__widget_id__delete","parameters":[{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cohort Id"}},{"name":"widget_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Widget Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cohorts/{cohort_id}/widgets/{widget_id}/refresh":{"post":{"tags":["insights"],"summary":"Refresh Widget Route","operationId":"refresh_widget_route_api_v1_cohorts__cohort_id__widgets__widget_id__refresh_post","parameters":[{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cohort Id"}},{"name":"widget_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Widget Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WidgetResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cohorts/{cohort_id}/widgets/{widget_id}/regenerate":{"post":{"tags":["insights"],"summary":"Regenerate Widget Route","operationId":"regenerate_widget_route_api_v1_cohorts__cohort_id__widgets__widget_id__regenerate_post","parameters":[{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cohort Id"}},{"name":"widget_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Widget Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WidgetResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cohorts/{cohort_id}/widgets/refresh-all":{"post":{"tags":["insights"],"summary":"Refresh All Widgets","operationId":"refresh_all_widgets_api_v1_cohorts__cohort_id__widgets_refresh_all_post","parameters":[{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Cohort Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_WidgetResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/insights":{"get":{"tags":["insights"],"summary":"List Insights","operationId":"list_insights_api_v1_insights_get","parameters":[{"name":"include_dismissed","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Dismissed"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/insights/refresh":{"post":{"tags":["insights"],"summary":"Refresh Insights","description":"Re-run the miner now. Findings refresh in place; dismissed ones stay dismissed.","operationId":"refresh_insights_api_v1_insights_refresh_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/insights/{insight_id}/dismiss":{"post":{"tags":["insights"],"summary":"Dismiss Insight","description":"Hide a finding, permanently. The miner will not file it again.","operationId":"dismiss_insight_api_v1_insights__insight_id__dismiss_post","parameters":[{"name":"insight_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Insight Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/threads":{"post":{"tags":["chat"],"summary":"Create Thread Route","operationId":"create_thread_route_api_v1_chat_threads_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatThreadCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ChatThreadResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["chat"],"summary":"List Threads Route","operationId":"list_threads_route_api_v1_chat_threads_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":50,"title":"Per Page"},"description":"Items per page"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedEnvelope_ChatThreadResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/threads/{thread_id}":{"delete":{"tags":["chat"],"summary":"Delete Thread Route","operationId":"delete_thread_route_api_v1_chat_threads__thread_id__delete","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/threads/{thread_id}/messages":{"post":{"tags":["chat"],"summary":"Send Message","description":"Send a message and get an AI response. In production this uses SSE streaming\nvia Anthropic's SDK. Currently returns a synchronous response.","operationId":"send_message_api_v1_chat_threads__thread_id__messages_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessageCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ChatMessageResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["chat"],"summary":"List Messages","operationId":"list_messages_api_v1_chat_threads__thread_id__messages_get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_ChatMessageResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/threads/{thread_id}/messages/stream":{"post":{"tags":["chat"],"summary":"Send Message Stream","description":"Persist-first: save the user message + a streaming assistant placeholder, kick off a\ndetached generator, and return the ids. The client then attaches to the events endpoint\nto stream the answer. Generation is decoupled from this request, so a refresh resumes it.","operationId":"send_message_stream_api_v1_chat_threads__thread_id__messages_stream_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessageCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/threads/{thread_id}/messages/{message_id}/events":{"get":{"tags":["chat"],"summary":"Message Events","description":"Attach to an assistant message's stream (initial or post-refresh resume): replays\nbuffered deltas then live-tails until done.","operationId":"message_events_api_v1_chat_threads__thread_id__messages__message_id__events_get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}},{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/threads/{thread_id}/messages/{message_id}/cancel":{"post":{"tags":["chat"],"summary":"Cancel Message","description":"Stop an in-flight generation; the generator marks the message cancelled.","operationId":"cancel_message_api_v1_chat_threads__thread_id__messages__message_id__cancel_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}},{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/link":{"post":{"tags":["bot"],"summary":"Bot Link Route","operationId":"bot_link_route_api_v1_bot_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotLinkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BotLinkResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/answer":{"post":{"tags":["bot"],"summary":"Bot Answer Route","description":"Channel-only Q&A. The data scope is decided by the CHANNEL the question was asked in\n(which client that channel is connected to in Minro) — never by who is asking. No\nchannel context (a DM), or a channel that isn't connected, returns no data. The asker's\nidentity is not used for scoping (kept only for rate-limiting / telemetry).","operationId":"bot_answer_route_api_v1_bot_answer_post","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"platform_user_id","in":"query","required":true,"schema":{"type":"string","title":"Platform User Id"}},{"name":"channel_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotAnswerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BotAnswerResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/ingest":{"post":{"tags":["bot"],"summary":"Bot Ingest Route","description":"Channel-memory ingestion. Stores messages ONLY for channels connected to a\nworkspace (same channel-scoping rule as /answer): an unconnected channel stores\nnothing and returns connected=false so the bot can stop sending for a while.\n\nAlso the reply-trigger signal: bot_thread=true means at least one ingested\nhuman message replies/threads onto a bot-authored message, so the bot process\nshould follow up via /answer (whose own rate limit throttles replies).","operationId":"bot_ingest_route_api_v1_bot_ingest_post","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"platform_user_id","in":"query","required":true,"schema":{"type":"string","title":"Platform User Id"}},{"name":"channel_id","in":"query","required":true,"schema":{"type":"string","title":"Channel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotIngestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BotIngestResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/reset":{"post":{"tags":["bot"],"summary":"Bot Reset Route","operationId":"bot_reset_route_api_v1_bot_reset_post","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"platform_user_id","in":"query","required":true,"schema":{"type":"string","title":"Platform User Id"}},{"name":"channel_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/briefing":{"get":{"tags":["bot"],"summary":"Bot Briefing Route","operationId":"bot_briefing_route_api_v1_bot_briefing_get","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"platform_user_id","in":"query","required":true,"schema":{"type":"string","title":"Platform User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BotBriefingResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/workspaces":{"get":{"tags":["bot"],"summary":"Bot Workspaces Route","description":"The workspaces this platform user is linked to (for the /switch picker).","operationId":"bot_workspaces_route_api_v1_bot_workspaces_get","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"platform_user_id","in":"query","required":true,"schema":{"type":"string","title":"Platform User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BotWorkspacesResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/switch-workspace":{"post":{"tags":["bot"],"summary":"Bot Switch Workspace Route","description":"Set which linked workspace the bot answers for this platform user. 404 if the user\nisn't linked to the requested workspace.","operationId":"bot_switch_workspace_route_api_v1_bot_switch_workspace_post","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"platform_user_id","in":"query","required":true,"schema":{"type":"string","title":"Platform User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotSwitchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BotSwitchResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/installation":{"get":{"tags":["bot"],"summary":"Bot Installation Route","description":"Resolve the bot token for a Slack team (multi-workspace). The Socket Mode bot calls\nthis to authorize each incoming event by team_id, so it can post back with the right\nworkspace's token without ever touching the DB itself. Falls back to the single-\nworkspace env token for a team that was installed manually (no OAuth row yet).","operationId":"bot_installation_route_api_v1_bot_installation_get","parameters":[{"name":"team_id","in":"query","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BotInstallationResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/draft/{draft_id}":{"get":{"tags":["bot"],"summary":"Bot Draft Detail Route","description":"Fetch a draft's current body for the edit modal (the button value can't carry it).","operationId":"bot_draft_detail_route_api_v1_bot_draft__draft_id__get","parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"platform_user_id","in":"query","required":true,"schema":{"type":"string","title":"Platform User Id"}},{"name":"channel_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BotDraftDetail_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/draft/{draft_id}/regenerate":{"post":{"tags":["bot"],"summary":"Bot Draft Regenerate Route","description":"Rewrite the draft body in the chosen inbox's voice (the 'Rewrite in this voice'\naction), returning the new body for the bot to edit the card in place.","operationId":"bot_draft_regenerate_route_api_v1_bot_draft__draft_id__regenerate_post","parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"platform_user_id","in":"query","required":true,"schema":{"type":"string","title":"Platform User Id"}},{"name":"channel_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotDraftRegenerateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BotDraftDetail_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/draft/{draft_id}/redraft":{"post":{"tags":["bot"],"summary":"Bot Draft Redraft Route","description":"Regenerate the draft's CONTENT in place (the card's 'Redraft because' menu),\npreserving its trigger event. Any reason lands in the feedback ledger with\nsource='slack_card' BEFORE generation, so a refused redraft never loses the\njudgment. Distinct from /regenerate, which only re-voices the existing body.","operationId":"bot_draft_redraft_route_api_v1_bot_draft__draft_id__redraft_post","parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"platform_user_id","in":"query","required":true,"schema":{"type":"string","title":"Platform User Id"}},{"name":"channel_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotDraftRedraftRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BotDraftDetail_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/draft/{draft_id}/approve":{"post":{"tags":["bot"],"summary":"Bot Draft Approve Route","description":"Approve (optionally edited) and send the draft from the chosen inbox (the card's\nswitcher), over Gmail. Idempotent: a second approve on a resolved draft is a no-op.","operationId":"bot_draft_approve_route_api_v1_bot_draft__draft_id__approve_post","parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"platform_user_id","in":"query","required":true,"schema":{"type":"string","title":"Platform User Id"}},{"name":"channel_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotDraftActionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BotDraftActionResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/agent/{agent_id}/approve-all-safe":{"post":{"tags":["bot"],"summary":"Bot Approve All Safe Route","description":"'Approve all safe' from the Slack digest card: enqueue sends for every safe-tier\npending draft of this agent. The worker does the sending (Resend-paced, exactly-once).\nCross-tenant guard: the agent must belong to the workspace resolved from the card's\nchannel, or it 404s.","operationId":"bot_approve_all_safe_route_api_v1_bot_agent__agent_id__approve_all_safe_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"platform_user_id","in":"query","required":true,"schema":{"type":"string","title":"Platform User Id"}},{"name":"channel_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BotAgentActionResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot/draft/{draft_id}/skip":{"post":{"tags":["bot"],"summary":"Bot Draft Skip Route","operationId":"bot_draft_skip_route_api_v1_bot_draft__draft_id__skip_post","parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Draft Id"}},{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"platform_user_id","in":"query","required":true,"schema":{"type":"string","title":"Platform User Id"}},{"name":"channel_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BotDraftActionResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations":{"get":{"tags":["integrations"],"summary":"List Integrations Route","operationId":"list_integrations_route_api_v1_integrations_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_IntegrationResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/{provider}/link-code":{"post":{"tags":["integrations"],"summary":"Mint Bot Link Code Route","description":"Mint a short-lived code the founder shows the bot to link their account.\n\nProvider-generic: works for discord today, slack next.","operationId":"mint_bot_link_code_route_api_v1_integrations__provider__link_code_post","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/slack/oauth/start":{"get":{"tags":["integrations"],"summary":"Slack Oauth Start Route","description":"Return the Slack install URL (OAuth v2). The wizard opens it; Slack redirects back\nto the callback with a code we exchange for this workspace's bot token. State is a\nshort-lived signed token binding the install to this workspace (CSRF + scoping).","operationId":"slack_oauth_start_route_api_v1_integrations_slack_oauth_start_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/slack/oauth/callback":{"get":{"tags":["integrations"],"summary":"Slack Oauth Callback Route","description":"Public OAuth redirect target (no auth header — Slack redirects the browser here).\nSecurity rests on the signed `state` and the server-side code exchange. Stores the\nworkspace's bot token and redirects back to the web app.","operationId":"slack_oauth_callback_route_api_v1_integrations_slack_oauth_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/slack/channels":{"get":{"tags":["integrations"],"summary":"Slack Channels Route","description":"Channels the Minro Slack bot is a member of — the founder picks one as the\napproval-card destination. Empty until Slack is linked and the bot is invited\nto at least one channel (`/invite @Minro`).","operationId":"slack_channels_route_api_v1_integrations_slack_channels_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/slack/approval-channel":{"post":{"tags":["integrations"],"summary":"Set Slack Approval Channel Route","description":"Set the workspace's Slack approval channel. Every Slack-delivery agent posts its\napproval cards here.","operationId":"set_slack_approval_channel_route_api_v1_integrations_slack_approval_channel_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackApprovalChannelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_IntegrationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/discord/channels":{"get":{"tags":["integrations"],"summary":"Discord Channels Route","description":"Text channels for the bot's servers. With `guild_id` (from the 'select your server'\nstep) it lists that server's channels; without it, the server(s) this workspace already\nhas bindings for. Empty until the bot is in a server it can read.","operationId":"discord_channels_route_api_v1_integrations_discord_channels_get","parameters":[{"name":"guild_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guild Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/discord/approval-channel":{"post":{"tags":["integrations"],"summary":"Set Discord Approval Channel Route","description":"Set the workspace's Discord approval channel. Every Discord-delivery agent posts its\napproval cards here. Stored on a dedicated install row keyed by guild_id (distinct from\nthe per-user /link rows), so it survives even if individual founders unlink.","operationId":"set_discord_approval_channel_route_api_v1_integrations_discord_approval_channel_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscordApprovalChannelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_IntegrationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/discord/servers":{"get":{"tags":["integrations"],"summary":"Discord Servers Route","description":"The Discord server(s) THIS workspace is bound to (captured when someone runs /link\ninside the server, or already configured). Scoped to the workspace's own servers — we\nnever list the global bot's other guilds, so one client can never see another client's\nserver. Empty until the workspace's server is bound (run /link in it).","operationId":"discord_servers_route_api_v1_integrations_discord_servers_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/{provider}/bot-channels":{"post":{"tags":["integrations"],"summary":"Connect Bot Channel Route","description":"Connect (or mute) a channel for this workspace's bot. Refuses Slack Connect /\nexternally-shared channels (they include another org's members, so they can't be a\nsafe data boundary) and channels already connected to a different workspace.","operationId":"connect_bot_channel_route_api_v1_integrations__provider__bot_channels_post","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotChannelConnectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/{provider}/bot-channels/{channel_id}":{"delete":{"tags":["integrations"],"summary":"Disconnect Bot Channel Route","description":"Remove a channel from this workspace's bot whitelist.","operationId":"disconnect_bot_channel_route_api_v1_integrations__provider__bot_channels__channel_id__delete","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/connect":{"post":{"tags":["integrations"],"summary":"Connect Route","operationId":"connect_route_api_v1_integrations_connect_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationConnectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_IntegrationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/{provider}/disconnect":{"post":{"tags":["integrations"],"summary":"Disconnect Route","operationId":"disconnect_route_api_v1_integrations__provider__disconnect_post","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/{provider}/status":{"get":{"tags":["integrations"],"summary":"Integration Status","operationId":"integration_status_api_v1_integrations__provider__status_get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_Union_IntegrationResponse__NoneType__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/{integration_id}/sync-status":{"get":{"tags":["integrations"],"summary":"Integration Sync Status","description":"Machine-readable sync observability for a single integration.\n\nReturns the raw ``sync_status`` JSONB (its shape documented on the model and\nwritten by the PostHog sync at its phase boundaries), plus the connection\n``status`` and ``last_synced_at``. ``sync_status`` is null for legacy rows or\na workspace that has never synced — callers must treat null as \"unknown\".\nScoped to the caller's workspace by the integration_id + workspace_id pair,\nso one workspace can't read another's sync state.","operationId":"integration_sync_status_api_v1_integrations__integration_id__sync_status_get","parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/{provider}/stats":{"get":{"tags":["integrations"],"summary":"Integration Stats","operationId":"integration_stats_api_v1_integrations__provider__stats_get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/{provider}/sync":{"post":{"tags":["integrations"],"summary":"Trigger Sync","operationId":"trigger_sync_api_v1_integrations__provider__sync_post","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invites/workspaces/{workspace_id}/invites":{"post":{"tags":["invites"],"summary":"Create Invite","operationId":"create_invite_api_v1_invites_workspaces__workspace_id__invites_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_InviteResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["invites"],"summary":"List Invites","operationId":"list_invites_api_v1_invites_workspaces__workspace_id__invites_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_InviteResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invites/workspaces/{workspace_id}/invites/{invite_id}":{"delete":{"tags":["invites"],"summary":"Revoke Invite","operationId":"revoke_invite_api_v1_invites_workspaces__workspace_id__invites__invite_id__delete","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invite Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invites/{token}":{"get":{"tags":["invites"],"summary":"Preview Invite","operationId":"preview_invite_api_v1_invites__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_InvitePreview_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invites/{token}/accept":{"post":{"tags":["invites"],"summary":"Accept Invite","operationId":"accept_invite_api_v1_invites__token__accept_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_InviteAcceptResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/voice-profile":{"get":{"tags":["voice"],"summary":"Get Voice Profile","operationId":"get_voice_profile_api_v1_voice_profile_get","parameters":[{"name":"inbox","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Gmail account email; omit for workspace default","title":"Inbox"},"description":"Gmail account email; omit for workspace default"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["voice"],"summary":"Update Voice Profile","operationId":"update_voice_profile_api_v1_voice_profile_patch","parameters":[{"name":"inbox","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbox"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileUpdateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/voice-profile/all":{"get":{"tags":["voice"],"summary":"List Voice Profiles","operationId":"list_voice_profiles_api_v1_voice_profile_all_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_dict__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/voice-profile/samples":{"post":{"tags":["voice"],"summary":"Add Sample","operationId":"add_sample_api_v1_voice_profile_samples_post","parameters":[{"name":"inbox","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbox"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SampleCreateBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/voice-profile/samples/{sample_id}":{"delete":{"tags":["voice"],"summary":"Delete Sample","operationId":"delete_sample_api_v1_voice_profile_samples__sample_id__delete","parameters":[{"name":"sample_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sample Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/voice-profile/extract":{"post":{"tags":["voice"],"summary":"Extract Voice","operationId":"extract_voice_api_v1_voice_profile_extract_post","parameters":[{"name":"inbox","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbox"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/stack-tensions":{"get":{"tags":["stack-tensions"],"summary":"List Tensions","description":"Open tensions for the workspace, optionally narrowed to one agent or one\nlayer ref (either side). \"candidate\" rows are internal and not listable.","operationId":"list_tensions_api_v1_stack_tensions_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"open","title":"Status"}},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"}},{"name":"ref","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/stack-tensions/stack":{"get":{"tags":["stack-tensions"],"summary":"Full Stack","description":"The Full picture: this agent's prompt stack in true prompt order, with\nprovenance, ages, and open-tension counts. Rendered from the assembly seam.","operationId":"full_stack_api_v1_stack_tensions_stack_get","parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/stack-tensions/{tension_id}/keep-both":{"post":{"tags":["stack-tensions"],"summary":"Keep Both","description":"Record an intentional exception. Pinned to both content hashes — the lint\nreopens the tension if either side's text later changes.","operationId":"keep_both_api_v1_stack_tensions__tension_id__keep_both_post","parameters":[{"name":"tension_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tension Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/stack-tensions/{tension_id}/resolution-preview":{"post":{"tags":["stack-tensions"],"summary":"Resolution Preview","description":"Dry preview: what would change and how far it reaches. Mutates nothing.","operationId":"resolution_preview_api_v1_stack_tensions__tension_id__resolution_preview_post","parameters":[{"name":"tension_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tension Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolutionBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/stack-tensions/{tension_id}/resolve":{"post":{"tags":["stack-tensions"],"summary":"Resolve Tension","description":"Apply the pick: edit the losing layer through the same rows the normal editors\nwrite, mark the tension resolved, and re-lint the stack.","operationId":"resolve_tension_api_v1_stack_tensions__tension_id__resolve_post","parameters":[{"name":"tension_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tension Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolutionBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/links":{"get":{"tags":["links"],"summary":"List Links","operationId":"list_links_api_v1_links_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["links"],"summary":"Create Link","operationId":"create_link_api_v1_links_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/links/{link_id}":{"patch":{"tags":["links"],"summary":"Update Link","operationId":"update_link_api_v1_links__link_id__patch","parameters":[{"name":"link_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Link Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["links"],"summary":"Delete Link","operationId":"delete_link_api_v1_links__link_id__delete","parameters":[{"name":"link_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Link Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/person-properties":{"get":{"tags":["posthog"],"summary":"Person Properties","description":"Return all distinct person property keys from PostHog.","operationId":"person_properties_api_v1_posthog_person_properties_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_str__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/filter-count":{"post":{"tags":["posthog"],"summary":"Filter Count","description":"Count persons matching the property filters, optionally gated by activity.","operationId":"filter_count_api_v1_posthog_filter_count_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterCountRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FilterCountResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/save-filters":{"post":{"tags":["posthog"],"summary":"Save Filters","description":"Save property filters to the PostHog integration config.","operationId":"save_filters_api_v1_posthog_save_filters_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveFiltersRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/start-import":{"post":{"tags":["posthog"],"summary":"Start Import","description":"Preview count, soft-delete old customers, and start filtered import.","operationId":"start_import_api_v1_posthog_start_import_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/saved-filters":{"get":{"tags":["posthog"],"summary":"Get Saved Filters","description":"Return the currently saved property filters + activity gate for PostHog.","operationId":"get_saved_filters_api_v1_posthog_saved_filters_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SavedFiltersResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/activity-events":{"get":{"tags":["posthog"],"summary":"Activity Events","description":"Event catalog for the activity filter UI: names + volumes (ranked desc),\nplus weight/category when classified. Drives Flow A (weight threshold) and\nFlow B (manual event pick).","operationId":"activity_events_api_v1_posthog_activity_events_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ActivityEventsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/event-volume":{"get":{"tags":["posthog"],"summary":"Event Volume","description":"Event + person volume over `days`, split into identified (events from a\nperson carrying an email, i.e. matchable to a customer) vs anonymous app\ntraffic, plus the same split for the top 20 events. Read-only. Sizes\nbatch-export billing (only identified rows are usable) and reconciliation\nscope (we only ever reconcile emailed persons).","operationId":"event_volume_api_v1_posthog_event_volume_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/query-probe":{"get":{"tags":["posthog"],"summary":"Query Probe","description":"Diagnostic (read-only, metadata only). Default: issue ONE fat-row windowed\nSELECT at `rows` LIMIT and report status/latency/bytes/headers (page-size 504\nonset). With `burst=N`: fire N light queries concurrently to trip the rate\nlimit and report how many 200s vs 429s and the Retry-After (real ceiling, since\nPostHog sends no limit header on success). Never returns event rows.","operationId":"query_probe_api_v1_posthog_query_probe_get","parameters":[{"name":"rows","in":"query","required":false,"schema":{"type":"integer","maximum":50000,"minimum":1,"default":10000,"title":"Rows"}},{"name":"burst","in":"query","required":false,"schema":{"type":"integer","maximum":400,"minimum":0,"default":0,"title":"Burst"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/classification-prompt":{"get":{"tags":["posthog"],"summary":"Classification Prompt","operationId":"classification_prompt_api_v1_posthog_classification_prompt_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClassificationPromptResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/classify-context":{"post":{"tags":["posthog"],"summary":"Save Classify Context","description":"Save product context answers so they are baked into the next prompt fetch.","operationId":"save_classify_context_api_v1_posthog_classify_context_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveContextRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/product-description":{"post":{"tags":["posthog"],"summary":"Update Product Description","description":"Update ONLY the workspace's product description — the text drafts, AI chat, and\ninsights use as product context. Leaves event classification and\nproduct_context_answers untouched, so it's safe to edit after a workspace is already\nclassified (the one-time onboarding setup screen redirects classified workspaces away,\nso this is the post-onboarding edit path).","operationId":"update_product_description_api_v1_posthog_product_description_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductDescriptionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/classify":{"post":{"tags":["posthog"],"summary":"Classify","operationId":"classify_api_v1_posthog_classify_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClassifyResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/classification-status":{"get":{"tags":["posthog"],"summary":"Classification Status","operationId":"classification_status_api_v1_posthog_classification_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ClassificationStatusResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/rescore-progress":{"get":{"tags":["posthog"],"summary":"Rescore Progress","description":"Return current rescore progress for this workspace, or null if not running.","operationId":"rescore_progress_api_v1_posthog_rescore_progress_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_Union_dict__NoneType__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/rescore":{"post":{"tags":["posthog"],"summary":"Trigger Rescore","description":"Re-score existing customers with the current classification weights.\n\nThis is the \"Reclassify\" action: it re-applies weights to customers we\nalready have (via rescore_posthog_customers, which maps emails->person_id\nover HogQL and does NOT re-import persons). New-person discovery is a\nseparate background job (posthog_sync), not this endpoint.","operationId":"trigger_rescore_api_v1_posthog_rescore_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/churn-ready":{"get":{"tags":["posthog"],"summary":"Churn Ready","operationId":"churn_ready_api_v1_posthog_churn_ready_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ChurnReadyResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/users-by-event":{"post":{"tags":["posthog"],"summary":"Users By Event","description":"Return all distinct user emails that fired any of the given events in the last N days.","operationId":"users_by_event_api_v1_posthog_users_by_event_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsersByEventRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_UsersByEventResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/classified-events":{"patch":{"tags":["posthog"],"summary":"Update Event Weight","description":"Update the weight (and optionally category) of a single classified event, then rescore.","operationId":"update_event_weight_api_v1_posthog_classified_events_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEventWeightRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["posthog"],"summary":"Classified Events","operationId":"classified_events_api_v1_posthog_classified_events_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_ClassifiedEvent__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/posthog/suggest-event-filter":{"post":{"tags":["posthog"],"summary":"Suggest Event Filter","description":"Given a natural-language description, generate a complete saved view spec.\n\nReturns label, health/plan filters, activity thresholds, and event groups ready\nto drop into the frontend ViewFilter schema.","operationId":"suggest_event_filter_api_v1_posthog_suggest_event_filter_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestEventFilterRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SuggestViewResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gmail/auth-url":{"get":{"tags":["gmail"],"summary":"Get Auth Url","operationId":"get_auth_url_api_v1_gmail_auth_url_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GmailAuthUrlResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gmail/callback":{"post":{"tags":["gmail"],"summary":"Gmail Callback","operationId":"gmail_callback_api_v1_gmail_callback_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailCallbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GmailCallbackResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gmail/sync":{"post":{"tags":["gmail"],"summary":"Sync Gmail","description":"Manually trigger a sync for all connected Gmail accounts.","operationId":"sync_gmail_api_v1_gmail_sync_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gmail/accounts":{"get":{"tags":["gmail"],"summary":"List Gmail Accounts","operationId":"list_gmail_accounts_api_v1_gmail_accounts_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_IntegrationResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gmail/accounts/{email}":{"delete":{"tags":["gmail"],"summary":"Disconnect Gmail Account","operationId":"disconnect_gmail_account_api_v1_gmail_accounts__email__delete","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gmail/send":{"post":{"tags":["gmail"],"summary":"Send Gmail","operationId":"send_gmail_api_v1_gmail_send_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailSendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_GmailSendResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gmail/threads/{gmail_thread_id}":{"get":{"tags":["gmail"],"summary":"Get Gmail Thread","operationId":"get_gmail_thread_api_v1_gmail_threads__gmail_thread_id__get","parameters":[{"name":"gmail_thread_id","in":"path","required":true,"schema":{"type":"string","title":"Gmail Thread Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_list_GmailThreadMessage__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/resend/send":{"post":{"tags":["resend"],"summary":"Send Resend","operationId":"send_resend_api_v1_resend_send_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendSendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResendSendResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/resend/audience/status":{"get":{"tags":["resend"],"summary":"Audience Status","description":"Progress of the Resend audience mirror, read from integration config.","operationId":"audience_status_api_v1_resend_audience_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AudienceStatusResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/resend/audience/sync":{"post":{"tags":["resend"],"summary":"Audience Sync","description":"Kick off a (chunked, background) mirror of all customers into the audience.","operationId":"audience_sync_api_v1_resend_audience_sync_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/resend/broadcast":{"post":{"tags":["resend"],"summary":"Send Broadcast","description":"Create + send (or schedule) a broadcast to the synced audience.","operationId":"send_broadcast_api_v1_resend_broadcast_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routes__resend__BroadcastRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BroadcastResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/autosend/send":{"post":{"tags":["autosend"],"summary":"Send Autosend","operationId":"send_autosend_api_v1_autosend_send_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutosendSendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AutosendSendResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/autosend/broadcast/status":{"get":{"tags":["autosend"],"summary":"Broadcast Status","description":"Progress of an in-flight (or last) AutoSend broadcast, read from config.","operationId":"broadcast_status_api_v1_autosend_broadcast_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BroadcastStatusResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/autosend/broadcast":{"post":{"tags":["autosend"],"summary":"Send Broadcast","description":"Kick off a (chunked, background) bulk send of one announcement to the whole base.\n\nAutoSend has no audience broadcast, so this fans the message out over the\nworkspace's customers in batches of 100. Progress is tracked in config and\nsurfaced via /autosend/broadcast/status.","operationId":"send_broadcast_api_v1_autosend_broadcast_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bearer <token>","title":"Authorization"},"description":"Bearer <token>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routes__autosend__BroadcastRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/gmail/push":{"post":{"tags":["webhooks"],"summary":"Gmail Push Notification","description":"Receive Gmail push notifications via Google Pub/Sub.\n\nMust respond 200 within 10 seconds. All processing is async via Celery.","operationId":"gmail_push_notification_api_v1_webhooks_gmail_push_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PubSubPush"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/ses/inbound":{"post":{"tags":["webhooks"],"summary":"Ses Inbound Webhook","description":"Reply-engine push feed: SNS notifications for SES-received mail.\n\nAuth mirrors the Gmail Pub/Sub webhook: a shared-secret token in the\nsubscription URL's query string. SNS posts JSON with Content-Type\ntext/plain, so the body is parsed manually. Processing is async via Celery;\nthe reconcile sweep (app/jobs/ses_inbound.sweep_ses_inbound) catches\nanything this endpoint ever misses.","operationId":"ses_inbound_webhook_api_v1_webhooks_ses_inbound_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/webhooks/open/{token}.gif":{"get":{"tags":["webhooks"],"summary":"Email Open Pixel","description":"Public tracking pixel. Records an open for `token` and returns a 1x1 GIF.\n\nLoaded by a recipient's mail client, so it must be unauthenticated and must ALWAYS\nreturn the image (even for an unknown/garbage token) so the email never shows a broken\nimage. The open record is best-effort and never affects the response.","operationId":"email_open_pixel_api_v1_webhooks_open__token__gif_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"}}}}}}},"/api/v1/webhooks/unsubscribe/{token}":{"get":{"tags":["webhooks"],"summary":"Unsubscribe Get","description":"Footer-link click: show the email-preferences page. Does NOT change state (scanner-safe).\n\nSuppression/re-subscription only happens on POST, so automated scanners/prefetchers that\nonly issue GETs can't opt real recipients out.","operationId":"unsubscribe_get_api_v1_webhooks_unsubscribe__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"}}}}}},"post":{"tags":["webhooks"],"summary":"Unsubscribe Post","description":"Apply the chosen preference. `choice=subscribe` re-subscribes; anything else\n(choice=unsubscribe, an RFC 8058 one-click body, or no field) unsubscribes -- so a\nmail client's List-Unsubscribe-Post=One-Click still opts out by default. Returns the\npreferences page reflecting the new state (a one-click client ignores the body).","operationId":"unsubscribe_post_api_v1_webhooks_unsubscribe__token__post","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"}}}}}}},"/api/v1/a/{token}":{"get":{"tags":["bot-actions"],"summary":"Bot Action Confirm Page","description":"Prefetch-safe confirm page: rendering has no side effects.","operationId":"bot_action_confirm_page_api_v1_a__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["bot-actions"],"summary":"Bot Action Execute","operationId":"bot_action_execute_api_v1_a__token__post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/healthz":{"get":{"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"ActivityEvent":{"properties":{"name":{"type":"string","title":"Name"},"count":{"type":"integer","title":"Count"},"weight":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},"type":"object","required":["name","count"],"title":"ActivityEvent"},"ActivityEventsResponse":{"properties":{"classification_status":{"type":"string","title":"Classification Status"},"events":{"items":{"$ref":"#/components/schemas/ActivityEvent"},"type":"array","title":"Events"}},"type":"object","required":["classification_status","events"],"title":"ActivityEventsResponse"},"ActivityFilter":{"properties":{"window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Window Days"},"mode":{"type":"string","title":"Mode","default":"any"},"threshold_weight":{"type":"number","title":"Threshold Weight","default":0.5},"manual_overrides":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Manual Overrides"},"manual_counted":{"items":{"type":"string"},"type":"array","title":"Manual Counted"}},"type":"object","title":"ActivityFilter","description":"The persisted 'active in last N days' rule (rule, not a frozen event list:\nweights/catalogs drift, so we resolve at query time)."},"AgentCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"channel":{"anyOf":[{"type":"string","enum":["email","push"]},{"type":"null"}],"title":"Channel"},"trigger_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Description"},"trigger_source":{"type":"string","enum":["posthog_event","subscription_event","enrichment","agent_chain","renewal_date","habit_rebuild","habit_maintenance","first_week","streak"],"title":"Trigger Source","default":"posthog_event"},"event_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Name"},"hogql_query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hogql Query"},"property_filters":{"items":{"$ref":"#/components/schemas/app__schemas__agent__PropertyFilter"},"type":"array","title":"Property Filters"},"trigger_clauses":{"items":{"$ref":"#/components/schemas/TriggerClause"},"type":"array","title":"Trigger Clauses"},"trigger_match":{"type":"string","enum":["any","all"],"title":"Trigger Match","default":"any"},"condition_window_days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Condition Window Days","default":30},"instructions":{"type":"string","minLength":1,"title":"Instructions"},"sender_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Account"},"sender_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Display Name"},"resend_from_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resend From Email"},"reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reply To"},"auto_send":{"type":"boolean","title":"Auto Send","default":false},"delivery_mode":{"type":"string","enum":["review","auto","slack","discord","resend","autosend","push","info"],"title":"Delivery Mode","default":"review"},"autonomy_level":{"anyOf":[{"type":"string","enum":["off","shadow","live"]},{"type":"null"}],"title":"Autonomy Level"},"info_channel":{"anyOf":[{"type":"string","enum":["slack","discord"]},{"type":"null"}],"title":"Info Channel"},"digest_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Digest Id"},"enrichment_backfill_days":{"type":"integer","maximum":365.0,"minimum":-1.0,"title":"Enrichment Backfill Days","default":0},"min_confidence":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Min Confidence","default":0.0},"enrichment_match_all":{"type":"boolean","title":"Enrichment Match All","default":false},"poll_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Poll From"},"trigger_delay_hours":{"type":"integer","maximum":8760.0,"minimum":0.0,"title":"Trigger Delay Hours","default":0},"trigger_delay_minutes":{"type":"integer","maximum":59.0,"minimum":0.0,"title":"Trigger Delay Minutes","default":0},"stale_after_hours":{"type":"integer","maximum":8760.0,"minimum":0.0,"title":"Stale After Hours"},"renewal_offset_days":{"type":"integer","maximum":365.0,"minimum":-365.0,"title":"Renewal Offset Days","default":0},"parent_agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Agent Id"},"exclusivity_group":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Exclusivity Group"},"priority":{"type":"integer","maximum":1000.0,"minimum":-1000.0,"title":"Priority","default":0},"holdout_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Holdout Enabled"},"ignore_list":{"items":{"type":"string"},"type":"array","title":"Ignore List"},"review_context_keys":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Review Context Keys"},"cooldown_days":{"type":"integer","maximum":365.0,"minimum":0.0,"title":"Cooldown Days","default":14},"daily_cap":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Daily Cap","default":20},"context_mode":{"type":"string","enum":["trigger","activity_window"],"title":"Context Mode","default":"activity_window"},"context_window_days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Context Window Days","default":30},"activity_gate":{"items":{"$ref":"#/components/schemas/GateCondition"},"type":"array","title":"Activity Gate"},"copy_mode":{"type":"string","enum":["ai","template"],"title":"Copy Mode","default":"ai"},"copy_variants":{"items":{"$ref":"#/components/schemas/CopyVariant"},"type":"array","title":"Copy Variants"},"enrichment_context_threshold":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Enrichment Context Threshold","default":0.0},"enrichment_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrichment Instructions"},"feedback_questions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedback Questions"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["name","instructions","stale_after_hours"],"title":"AgentCreate"},"AgentDraftCounts":{"properties":{"pending":{"type":"integer","title":"Pending","default":0},"sent":{"type":"integer","title":"Sent","default":0},"skipped":{"type":"integer","title":"Skipped","default":0},"safe":{"type":"integer","title":"Safe","default":0},"drafted_users":{"type":"integer","title":"Drafted Users","default":0}},"type":"object","title":"AgentDraftCounts","description":"True draft totals for one agent (GET /agents/draft-counts): status counts from a\nGROUP BY over ALL drafts, plus ``safe`` = classified safe-tier pendings minus rows a\nworker is already draining — the number an 'Approve all safe' would send."},"AgentDryRunItem":{"properties":{"customer_id":{"type":"string","format":"uuid","title":"Customer Id"},"recipient":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient"},"would_fire":{"type":"boolean","title":"Would Fire"},"suppression_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suppression Reason"},"delivery_mode":{"type":"string","title":"Delivery Mode"},"scheduled_for":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled For"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"}},"type":"object","required":["customer_id","recipient","would_fire","suppression_reason","delivery_mode","scheduled_for"],"title":"AgentDryRunItem"},"AgentDryRunRequest":{"properties":{"customer_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Customer Ids"},"sample_size":{"type":"integer","maximum":25.0,"minimum":1.0,"title":"Sample Size","default":10},"render":{"type":"boolean","title":"Render","default":true},"copy_variants":{"anyOf":[{"items":{"$ref":"#/components/schemas/CopyVariant"},"type":"array"},{"type":"null"}],"title":"Copy Variants"},"copy_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Copy Mode"}},"type":"object","title":"AgentDryRunRequest","description":"Render what an agent WOULD send to specific (or sampled) real customers, with\nthe fire/suppress decision per customer. Sends nothing — read-only dry run."},"AgentDryRunResponse":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/AgentDryRunItem"},"type":"array","title":"Items"}},"type":"object","required":["agent_id","count"],"title":"AgentDryRunResponse"},"AgentFeedbackSummary":{"properties":{"instructions_version":{"type":"integer","title":"Instructions Version"},"sent_asis":{"type":"integer","title":"Sent Asis","default":0},"edit_diff":{"type":"integer","title":"Edit Diff","default":0},"skip":{"type":"integer","title":"Skip","default":0},"reason_chip":{"type":"integer","title":"Reason Chip","default":0},"note":{"type":"integer","title":"Note","default":0},"total":{"type":"integer","title":"Total","default":0},"recent_notes":{"items":{"type":"string"},"type":"array","title":"Recent Notes"},"reason_tags":{"additionalProperties":{"type":"integer"},"type":"object","title":"Reason Tags"},"last_signal_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Signal At"},"last_applied_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Applied At"},"baseline_edit_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Baseline Edit Rate"},"current_edit_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Edit Rate"}},"type":"object","required":["instructions_version"],"title":"AgentFeedbackSummary","description":"Editor signal rail: what the ledger holds for the CURRENT instructions\nversion (version-gated — a manual edit resets the window)."},"AgentIntersectionRow":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"agent_name":{"type":"string","title":"Agent Name"},"exclusivity_group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exclusivity Group"},"priority":{"type":"integer","title":"Priority","default":0},"overlap":{"type":"integer","title":"Overlap","default":0},"would_suppress":{"type":"integer","title":"Would Suppress","default":0},"did_double_send":{"type":"integer","title":"Did Double Send","default":0}},"type":"object","required":["agent_id","agent_name"],"title":"AgentIntersectionRow","description":"One other agent that reached this agent's audience, and how hard they collided.\n\nThe three counts are deliberately different questions:\n\n  - ``overlap``     : both agents CLAIMED the same person inside the window.\n  - ``would_suppress``: how many of those overlaps today's group configuration already\n    arbitrates. Zero when the pair is not grouped, which is the number the operator is\n    deciding whether to move.\n  - ``did_double_send``: both runs actually DELIVERED. Real damage that already\n    happened, group or no group, and the argument for turning arbitration on."},"AgentIntersectionsResponse":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"days":{"type":"integer","title":"Days"},"window_hours":{"type":"integer","title":"Window Hours"},"exclusivity_group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exclusivity Group"},"priority":{"type":"integer","title":"Priority","default":0},"rows":{"items":{"$ref":"#/components/schemas/AgentIntersectionRow"},"type":"array","title":"Rows"}},"type":"object","required":["agent_id","days","window_hours"],"title":"AgentIntersectionsResponse"},"AgentPollLogResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"status":{"type":"string","title":"Status"},"polled_since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Polled Since"},"polled_at":{"type":"string","format":"date-time","title":"Polled At"},"emails_returned":{"type":"integer","title":"Emails Returned"},"customers_matched":{"type":"integer","title":"Customers Matched"},"customers_unmatched":{"type":"integer","title":"Customers Unmatched","default":0},"fired":{"type":"integer","title":"Fired"},"skipped_cooldown":{"type":"integer","title":"Skipped Cooldown"},"skipped_cap":{"type":"integer","title":"Skipped Cap"},"skipped_ignored":{"type":"integer","title":"Skipped Ignored","default":0},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"fired_customer_ids":{"items":{"type":"string"},"type":"array","title":"Fired Customer Ids"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","agent_id","status","polled_since","polled_at","emails_returned","customers_matched","fired","skipped_cooldown","skipped_cap","error","fired_customer_ids","created_at"],"title":"AgentPollLogResponse"},"AgentPreviewRequest":{"properties":{"event_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Name"},"property_filters":{"items":{"$ref":"#/components/schemas/app__schemas__agent__PropertyFilter"},"type":"array","title":"Property Filters"},"trigger_clauses":{"items":{"$ref":"#/components/schemas/TriggerClause"},"type":"array","title":"Trigger Clauses"},"trigger_match":{"type":"string","enum":["any","all"],"title":"Trigger Match","default":"any"},"condition_window_days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Condition Window Days","default":30},"window_days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Window Days","default":7},"daily_cap":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Daily Cap","default":20},"activity_gate":{"items":{"$ref":"#/components/schemas/GateCondition"},"type":"array","title":"Activity Gate"}},"type":"object","title":"AgentPreviewRequest"},"AgentPreviewResponse":{"properties":{"window_days":{"type":"integer","title":"Window Days"},"matched":{"type":"integer","title":"Matched"},"known_customers":{"type":"integer","title":"Known Customers"},"estimated_sends":{"type":"integer","title":"Estimated Sends"},"ok":{"type":"boolean","title":"Ok","default":true},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"}},"type":"object","required":["window_days","matched","known_customers","estimated_sends"],"title":"AgentPreviewResponse"},"AgentProposalDecision":{"properties":{"redraft_pending":{"type":"boolean","title":"Redraft Pending","default":true},"edited_addition":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Edited Addition"}},"type":"object","title":"AgentProposalDecision"},"AgentProposalResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"status":{"type":"string","title":"Status"},"scope":{"type":"string","title":"Scope"},"suggested_addition":{"type":"string","title":"Suggested Addition"},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"op":{"type":"string","title":"Op","default":"append"},"edit_target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Edit Target"},"edit_spans":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Edit Spans"},"finding_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finding Kind"},"prediction":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Prediction"},"receipts":{"items":{"$ref":"#/components/schemas/RefineReceipt"},"type":"array","title":"Receipts"},"evidence_count":{"type":"integer","title":"Evidence Count"},"distinct_customers":{"type":"integer","title":"Distinct Customers"},"sent_asis_count":{"type":"integer","title":"Sent Asis Count"},"instructions_version":{"type":"integer","title":"Instructions Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","agent_id","status","scope","suggested_addition","evidence_count","distinct_customers","sent_asis_count","instructions_version","created_at"],"title":"AgentProposalResponse","description":"A mined one-line instruction proposal — human-gated, receipts attached."},"AgentRefineRequest":{"properties":{"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"}},"type":"object","title":"AgentRefineRequest","description":"Minimal-edit refine (docs/refine-flow-redesign.md). Two callers:\nan 'Every draft' scoped note (note set), or the editor's 'Suggest an\nimprovement' button (empty body — the endpoint reads the feedback ledger)."},"AgentRefineResponse":{"properties":{"suggested_addition":{"type":"string","title":"Suggested Addition"},"rationale":{"type":"string","title":"Rationale"},"receipts":{"items":{"$ref":"#/components/schemas/RefineReceipt"},"type":"array","title":"Receipts"},"instructions_version":{"type":"integer","title":"Instructions Version"}},"type":"object","required":["suggested_addition","rationale","instructions_version"],"title":"AgentRefineResponse"},"AgentResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"trigger_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Description"},"trigger_source":{"type":"string","title":"Trigger Source","default":"posthog_event"},"event_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Name"},"hogql_query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hogql Query"},"property_filters":{"items":{"$ref":"#/components/schemas/app__schemas__agent__PropertyFilter"},"type":"array","title":"Property Filters"},"trigger_clauses":{"items":{"$ref":"#/components/schemas/TriggerClause"},"type":"array","title":"Trigger Clauses"},"trigger_match":{"type":"string","title":"Trigger Match"},"condition_window_days":{"type":"integer","title":"Condition Window Days"},"last_polled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Polled At"},"instructions":{"type":"string","title":"Instructions"},"instructions_version":{"type":"integer","title":"Instructions Version","default":1},"sender_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Account"},"sender_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Display Name"},"resend_from_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resend From Email"},"reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reply To"},"auto_send":{"type":"boolean","title":"Auto Send"},"delivery_mode":{"type":"string","title":"Delivery Mode","default":"review"},"channel":{"type":"string","title":"Channel","default":"email"},"autonomy_level":{"type":"string","title":"Autonomy Level","default":"off"},"holdout_enabled":{"type":"boolean","title":"Holdout Enabled","default":false},"info_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Info Channel"},"digest_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Digest Id"},"enrichment_backfill_days":{"type":"integer","title":"Enrichment Backfill Days","default":0},"min_confidence":{"type":"number","title":"Min Confidence","default":0.0},"enrichment_match_all":{"type":"boolean","title":"Enrichment Match All","default":false},"poll_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Poll From"},"trigger_delay_hours":{"type":"integer","title":"Trigger Delay Hours","default":0},"trigger_delay_minutes":{"type":"integer","title":"Trigger Delay Minutes","default":0},"stale_after_hours":{"type":"integer","title":"Stale After Hours","default":0},"renewal_offset_days":{"type":"integer","title":"Renewal Offset Days","default":0},"parent_agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Agent Id"},"exclusivity_group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exclusivity Group"},"priority":{"type":"integer","title":"Priority","default":0},"ignore_list":{"items":{"type":"string"},"type":"array","title":"Ignore List"},"review_context_keys":{"items":{"type":"string"},"type":"array","title":"Review Context Keys"},"cooldown_days":{"type":"integer","title":"Cooldown Days"},"daily_cap":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Daily Cap"},"context_mode":{"type":"string","title":"Context Mode"},"context_window_days":{"type":"integer","title":"Context Window Days"},"activity_gate":{"items":{"$ref":"#/components/schemas/GateCondition"},"type":"array","title":"Activity Gate"},"copy_mode":{"type":"string","title":"Copy Mode","default":"ai"},"copy_variants":{"items":{"$ref":"#/components/schemas/CopyVariant"},"type":"array","title":"Copy Variants"},"enrichment_context_threshold":{"type":"number","title":"Enrichment Context Threshold","default":0.0},"enrichment_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrichment Instructions"},"feedback_questions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedback Questions"},"enabled":{"type":"boolean","title":"Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"runs_today":{"type":"integer","title":"Runs Today","default":0},"total_runs":{"type":"integer","title":"Total Runs","default":0},"total_sends":{"type":"integer","title":"Total Sends","default":0},"matured_sends":{"type":"integer","title":"Matured Sends","default":0},"open_rate_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Open Rate Pct"},"push_sends":{"type":"integer","title":"Push Sends","default":0},"push_opens":{"type":"integer","title":"Push Opens","default":0},"return_adjudicated":{"type":"integer","title":"Return Adjudicated","default":0},"return_returned":{"type":"integer","title":"Return Returned","default":0},"return_rate_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Return Rate Pct"},"return_window_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Return Window Hours"},"feedback_signal_count":{"type":"integer","title":"Feedback Signal Count","default":0},"live_proposal_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Live Proposal Id"},"live_proposal_count":{"type":"integer","title":"Live Proposal Count","default":0},"last_open_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Open At"},"redraft_count":{"type":"integer","title":"Redraft Count","default":0},"health":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Health"},"health_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Health Reason"}},"type":"object","required":["id","workspace_id","name","trigger_description","event_name","hogql_query","trigger_match","condition_window_days","last_polled_at","instructions","sender_account","auto_send","cooldown_days","daily_cap","context_mode","context_window_days","enabled","created_at","updated_at"],"title":"AgentResponse"},"AgentRunResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"customer_id":{"type":"string","format":"uuid","title":"Customer Id"},"draft_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Draft Id"},"status":{"type":"string","title":"Status"},"triggered_at":{"type":"string","format":"date-time","title":"Triggered At"},"trigger_context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Trigger Context"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"customer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Email"},"alert_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alert Text"}},"type":"object","required":["id","agent_id","customer_id","draft_id","status","triggered_at","trigger_context","created_at"],"title":"AgentRunResponse"},"AgentUpdate":{"properties":{"channel":{"anyOf":[{"type":"string","enum":["email","push"]},{"type":"null"}],"title":"Channel"},"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"trigger_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Description"},"trigger_source":{"anyOf":[{"type":"string","enum":["posthog_event","subscription_event","enrichment","agent_chain","renewal_date","habit_rebuild","habit_maintenance","first_week","streak"]},{"type":"null"}],"title":"Trigger Source"},"event_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Name"},"hogql_query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hogql Query"},"property_filters":{"anyOf":[{"items":{"$ref":"#/components/schemas/app__schemas__agent__PropertyFilter"},"type":"array"},{"type":"null"}],"title":"Property Filters"},"trigger_clauses":{"anyOf":[{"items":{"$ref":"#/components/schemas/TriggerClause"},"type":"array"},{"type":"null"}],"title":"Trigger Clauses"},"trigger_match":{"anyOf":[{"type":"string","enum":["any","all"]},{"type":"null"}],"title":"Trigger Match"},"condition_window_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Condition Window Days"},"instructions":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Instructions"},"sender_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Account"},"sender_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Display Name"},"resend_from_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resend From Email"},"reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reply To"},"auto_send":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Send"},"delivery_mode":{"anyOf":[{"type":"string","enum":["review","auto","slack","discord","resend","autosend","push","info"]},{"type":"null"}],"title":"Delivery Mode"},"autonomy_level":{"anyOf":[{"type":"string","enum":["off","shadow","live"]},{"type":"null"}],"title":"Autonomy Level"},"holdout_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Holdout Enabled"},"info_channel":{"anyOf":[{"type":"string","enum":["slack","discord"]},{"type":"null"}],"title":"Info Channel"},"digest_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Digest Id"},"enrichment_backfill_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":-1.0},{"type":"null"}],"title":"Enrichment Backfill Days"},"min_confidence":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Min Confidence"},"enrichment_match_all":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enrichment Match All"},"poll_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Poll From"},"trigger_delay_hours":{"anyOf":[{"type":"integer","maximum":8760.0,"minimum":0.0},{"type":"null"}],"title":"Trigger Delay Hours"},"trigger_delay_minutes":{"anyOf":[{"type":"integer","maximum":59.0,"minimum":0.0},{"type":"null"}],"title":"Trigger Delay Minutes"},"stale_after_hours":{"anyOf":[{"type":"integer","maximum":8760.0,"minimum":0.0},{"type":"null"}],"title":"Stale After Hours"},"renewal_offset_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":-365.0},{"type":"null"}],"title":"Renewal Offset Days"},"exclusivity_group":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Exclusivity Group"},"priority":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":-1000.0},{"type":"null"}],"title":"Priority"},"parent_agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Agent Id"},"ignore_list":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Ignore List"},"review_context_keys":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":20},{"type":"null"}],"title":"Review Context Keys"},"cooldown_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":0.0},{"type":"null"}],"title":"Cooldown Days"},"daily_cap":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Daily Cap"},"context_mode":{"anyOf":[{"type":"string","enum":["trigger","activity_window"]},{"type":"null"}],"title":"Context Mode"},"context_window_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Context Window Days"},"activity_gate":{"anyOf":[{"items":{"$ref":"#/components/schemas/GateCondition"},"type":"array"},{"type":"null"}],"title":"Activity Gate"},"copy_mode":{"anyOf":[{"type":"string","enum":["ai","template"]},{"type":"null"}],"title":"Copy Mode"},"copy_variants":{"anyOf":[{"items":{"$ref":"#/components/schemas/CopyVariant"},"type":"array"},{"type":"null"}],"title":"Copy Variants"},"enrichment_context_threshold":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Enrichment Context Threshold"},"enrichment_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrichment Instructions"},"feedback_questions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedback Questions"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"skip_redraft":{"type":"boolean","title":"Skip Redraft","default":false},"base_instructions_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Base Instructions Version"}},"type":"object","title":"AgentUpdate"},"AnalyticsIgnoreListUpdate":{"properties":{"emails":{"items":{"type":"string"},"type":"array","title":"Emails"}},"type":"object","required":["emails"],"title":"AnalyticsIgnoreListUpdate"},"AudiencePreview":{"properties":{"audience":{"$ref":"#/components/schemas/AudienceSpec"}},"type":"object","required":["audience"],"title":"AudiencePreview"},"AudienceSpec":{"properties":{"mode":{"type":"string","title":"Mode","default":"customers"},"customer_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Customer Ids"},"filter":{"additionalProperties":true,"type":"object","title":"Filter"},"include_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Include Ids"},"exclude_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Exclude Ids"},"view_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"View Label"}},"type":"object","title":"AudienceSpec"},"AudienceStatusResponse":{"properties":{"audience_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audience Id"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"synced_count":{"type":"integer","title":"Synced Count","default":0},"unsubscribed_count":{"type":"integer","title":"Unsubscribed Count","default":0},"syncing":{"type":"boolean","title":"Syncing","default":false}},"type":"object","title":"AudienceStatusResponse"},"AuthResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"user":{"$ref":"#/components/schemas/UserResponse"}},"type":"object","required":["access_token","refresh_token","user"],"title":"AuthResponse"},"AutosendSendRequest":{"properties":{"to":{"type":"string","title":"To"},"subject":{"type":"string","title":"Subject"},"body_html":{"type":"string","title":"Body Html"},"body_plain":{"type":"string","title":"Body Plain"},"reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reply To"},"draft_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Draft Id"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"}},"type":"object","required":["to","subject","body_html","body_plain"],"title":"AutosendSendRequest"},"AutosendSendResponse":{"properties":{"autosend_message_id":{"type":"string","title":"Autosend Message Id"}},"type":"object","required":["autosend_message_id"],"title":"AutosendSendResponse"},"BacktestFire":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"event_ts":{"type":"string","title":"Event Ts"},"scheduled_for":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled For"}},"type":"object","required":["customer_id","event_ts"],"title":"BacktestFire"},"BacktestReport":{"properties":{"window_days":{"type":"integer","title":"Window Days"},"supported":{"type":"boolean","title":"Supported","default":true},"total_candidates":{"type":"integer","title":"Total Candidates","default":0},"truncated":{"type":"boolean","title":"Truncated","default":false},"would_fire":{"type":"integer","title":"Would Fire","default":0},"fires":{"items":{"$ref":"#/components/schemas/BacktestFire"},"type":"array","title":"Fires"},"suppressed":{"additionalProperties":{"type":"integer"},"type":"object","title":"Suppressed"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"}},"type":"object","required":["window_days"],"title":"BacktestReport","description":"Replay of a config over the trailing window. ``notes`` carries every\nhonesty caveat (truncation, gates not simulated, unmatched events) — the UI\nand the copilot must surface them, never just the fire count."},"BacktestRequest":{"properties":{"config":{"$ref":"#/components/schemas/AgentCreate"},"window_days":{"type":"integer","maximum":90.0,"minimum":1.0,"title":"Window Days","default":30}},"type":"object","required":["config"],"title":"BacktestRequest"},"BillingSection":{"properties":{"total_subscription_events":{"type":"integer","title":"Total Subscription Events","default":0},"sources":{"items":{"$ref":"#/components/schemas/ValueCount"},"type":"array","title":"Sources"},"statuses":{"items":{"$ref":"#/components/schemas/ValueCount"},"type":"array","title":"Statuses"},"plans":{"items":{"$ref":"#/components/schemas/ValueCount"},"type":"array","title":"Plans"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"BillingSection"},"Body_import_customers_route_api_v1_customers_import_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_customers_route_api_v1_customers_import_post"},"Body_upload_document_api_v1_documents_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}},"type":"object","required":["file"],"title":"Body_upload_document_api_v1_documents_post"},"BotAgentActionResult":{"properties":{"status":{"type":"string","title":"Status"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"count":{"type":"integer","title":"Count","default":0},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["status"],"title":"BotAgentActionResult"},"BotAnswerRequest":{"properties":{"text":{"type":"string","title":"Text"},"trigger":{"type":"string","title":"Trigger","default":"mention"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"author_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Name"},"reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reply To"},"reply_channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reply Channel Id"}},"type":"object","required":["text"],"title":"BotAnswerRequest"},"BotAnswerResult":{"properties":{"answer":{"type":"string","title":"Answer"},"connected":{"type":"boolean","title":"Connected","default":true},"should_reply":{"type":"boolean","title":"Should Reply","default":true},"queued":{"type":"boolean","title":"Queued","default":false}},"type":"object","required":["answer"],"title":"BotAnswerResult"},"BotBriefingResult":{"properties":{"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"BotBriefingResult"},"BotChannelConnectRequest":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"channel_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Name"},"guild_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guild Id"},"kind":{"type":"string","title":"Kind","default":"connected"}},"type":"object","required":["channel_id"],"title":"BotChannelConnectRequest"},"BotDraftActionRequest":{"properties":{"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"sender_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Account"},"approver":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approver"}},"type":"object","title":"BotDraftActionRequest"},"BotDraftActionResult":{"properties":{"status":{"type":"string","title":"Status"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["status"],"title":"BotDraftActionResult"},"BotDraftDetail":{"properties":{"draft_id":{"type":"string","title":"Draft Id"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body":{"type":"string","title":"Body"},"status":{"type":"string","title":"Status"}},"type":"object","required":["draft_id","body","status"],"title":"BotDraftDetail"},"BotDraftRedraftRequest":{"properties":{"reason_tag":{"anyOf":[{"type":"string","enum":["too_long","wrong_tone","weak_opener","wrong_facts"]},{"type":"null"}],"title":"Reason Tag"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"},"scope":{"anyOf":[{"type":"string","enum":["this_draft","every_draft"]},{"type":"null"}],"title":"Scope"}},"type":"object","title":"BotDraftRedraftRequest","description":"The card's 'Redraft because' menu (refine flow). Mirrors the web split button:\none dispatch carries the reason; the judgment lands in the feedback ledger."},"BotDraftRegenerateRequest":{"properties":{"sender_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Account"}},"type":"object","title":"BotDraftRegenerateRequest"},"BotIngestMessage":{"properties":{"platform_message_id":{"type":"string","title":"Platform Message Id"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"referenced_message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referenced Message Id"},"author_id":{"type":"string","title":"Author Id"},"author_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Name"},"is_bot":{"type":"boolean","title":"Is Bot","default":false},"is_self":{"type":"boolean","title":"Is Self","default":false},"text":{"type":"string","title":"Text"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"}},"type":"object","required":["platform_message_id","author_id","text"],"title":"BotIngestMessage"},"BotIngestRequest":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/BotIngestMessage"},"type":"array","title":"Messages"}},"type":"object","required":["messages"],"title":"BotIngestRequest"},"BotIngestResult":{"properties":{"stored":{"type":"integer","title":"Stored","default":0},"connected":{"type":"boolean","title":"Connected","default":false},"bot_thread":{"type":"boolean","title":"Bot Thread","default":false}},"type":"object","title":"BotIngestResult"},"BotInstallationResult":{"properties":{"bot_token":{"type":"string","title":"Bot Token"},"bot_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot User Id"}},"type":"object","required":["bot_token"],"title":"BotInstallationResult"},"BotLinkRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"code":{"type":"string","title":"Code"},"platform_user_id":{"type":"string","title":"Platform User Id"},"platform_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform Username"},"guild_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guild Id"}},"type":"object","required":["provider","code","platform_user_id"],"title":"BotLinkRequest"},"BotLinkResult":{"properties":{"linked":{"type":"boolean","title":"Linked"},"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id"}},"type":"object","required":["linked"],"title":"BotLinkResult"},"BotSwitchRequest":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id"}},"type":"object","required":["workspace_id"],"title":"BotSwitchRequest"},"BotSwitchResult":{"properties":{"switched":{"type":"boolean","title":"Switched"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["switched"],"title":"BotSwitchResult"},"BotWorkspace":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"active":{"type":"boolean","title":"Active","default":false}},"type":"object","required":["workspace_id"],"title":"BotWorkspace"},"BotWorkspacesResult":{"properties":{"workspaces":{"items":{"$ref":"#/components/schemas/BotWorkspace"},"type":"array","title":"Workspaces"}},"type":"object","required":["workspaces"],"title":"BotWorkspacesResult"},"BroadcastResponse":{"properties":{"broadcast_id":{"type":"string","title":"Broadcast Id"},"scheduled":{"type":"boolean","title":"Scheduled"}},"type":"object","required":["broadcast_id","scheduled"],"title":"BroadcastResponse"},"BroadcastStatusResponse":{"properties":{"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"sent_count":{"type":"integer","title":"Sent Count","default":0},"failed_count":{"type":"integer","title":"Failed Count","default":0},"sending":{"type":"boolean","title":"Sending","default":false}},"type":"object","title":"BroadcastStatusResponse"},"BugCreate":{"properties":{"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"source_channel":{"type":"string","maxLength":100,"title":"Source Channel"},"excerpt":{"type":"string","title":"Excerpt"},"title":{"type":"string","maxLength":500,"title":"Title"},"severity":{"type":"string","title":"Severity","default":"medium"}},"type":"object","required":["source_channel","excerpt","title"],"title":"BugCreate"},"BugFileRequest":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"},"assignee_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee Id"}},"type":"object","title":"BugFileRequest"},"BugFileResponse":{"properties":{"bug_id":{"type":"string","format":"uuid","title":"Bug Id"},"linear_ticket_id":{"type":"string","title":"Linear Ticket Id"},"linear_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linear Url"}},"type":"object","required":["bug_id","linear_ticket_id"],"title":"BugFileResponse"},"BugResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"source_channel":{"type":"string","title":"Source Channel"},"excerpt":{"type":"string","title":"Excerpt"},"title":{"type":"string","title":"Title"},"severity":{"type":"string","title":"Severity"},"status":{"type":"string","title":"Status"},"linear_ticket_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linear Ticket Id"},"affected_count":{"type":"integer","title":"Affected Count","default":1},"similar_count":{"type":"integer","title":"Similar Count","default":0},"reporter_name":{"type":"string","title":"Reporter Name","default":""},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"detected_at":{"type":"string","format":"date-time","title":"Detected At"},"triaged_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Triaged At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","workspace_id","source_channel","excerpt","title","severity","status","detected_at","created_at"],"title":"BugResponse"},"BugUpdateRequest":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"linear_ticket_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linear Ticket Id"}},"type":"object","title":"BugUpdateRequest"},"BulkActionResult":{"properties":{"action":{"type":"string","title":"Action"},"count":{"type":"integer","title":"Count","default":0}},"type":"object","required":["action"],"title":"BulkActionResult"},"BulkApproveRequest":{"properties":{"draft_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Draft Ids"},"only_safe":{"type":"boolean","title":"Only Safe","default":false},"only_flagged":{"type":"boolean","title":"Only Flagged","default":false},"filters":{"anyOf":[{"$ref":"#/components/schemas/RecipientFilters"},{"type":"null"}]}},"type":"object","title":"BulkApproveRequest","description":"Approve (send) many of an agent's pending drafts. Explicit ``draft_ids`` win; otherwise\n``only_safe`` / ``only_flagged`` sends every draft of that tier, scoped to ``filters``\nwhen the review queue has recipient filters or a search active."},"BulkSkipRequest":{"properties":{"draft_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Draft Ids"}},"type":"object","title":"BulkSkipRequest","description":"Skip many of an agent's pending drafts in one call (review-queue bulk action)."},"ChannelsSection":{"properties":{"connected_providers":{"items":{"type":"string"},"type":"array","title":"Connected Providers"},"available_delivery_modes":{"items":{"type":"string"},"type":"array","title":"Available Delivery Modes"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"ChannelsSection"},"ChatMessageCreate":{"properties":{"content":{"type":"string","maxLength":4000,"minLength":1,"title":"Content"}},"type":"object","required":["content"],"title":"ChatMessageCreate"},"ChatMessageResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"thread_id":{"type":"string","format":"uuid","title":"Thread Id"},"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"},"status":{"type":"string","title":"Status","default":"complete"},"query_sql":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Sql"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","thread_id","role","content","created_at"],"title":"ChatMessageResponse"},"ChatThreadCreate":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}},"type":"object","title":"ChatThreadCreate"},"ChatThreadResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"message_count":{"type":"integer","title":"Message Count","default":0}},"type":"object","required":["id","workspace_id","created_at"],"title":"ChatThreadResponse"},"ChurnDistribution":{"properties":{"bins":{"items":{"type":"integer"},"type":"array","title":"Bins","default":[]},"total":{"type":"integer","title":"Total","default":0},"high_risk":{"type":"integer","title":"High Risk","default":0},"avg":{"type":"number","title":"Avg","default":0.0}},"type":"object","title":"ChurnDistribution"},"ChurnReadyResponse":{"properties":{"ready":{"type":"boolean","title":"Ready"},"churn_ready_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Churn Ready At"}},"type":"object","required":["ready"],"title":"ChurnReadyResponse"},"ClassificationPromptResponse":{"properties":{"prompt":{"type":"string","title":"Prompt"},"event_count":{"type":"integer","title":"Event Count"},"event_names":{"items":{"type":"string"},"type":"array","title":"Event Names"}},"type":"object","required":["prompt","event_count","event_names"],"title":"ClassificationPromptResponse"},"ClassificationStatusResponse":{"properties":{"status":{"type":"string","title":"Status"},"classified_event_count":{"type":"integer","title":"Classified Event Count"},"product_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Description"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"churn_ready_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Churn Ready At"}},"type":"object","required":["status","classified_event_count","updated_at"],"title":"ClassificationStatusResponse"},"ClassifiedEvent":{"properties":{"event_name":{"type":"string","title":"Event Name"},"category":{"type":"string","title":"Category"},"weight":{"type":"number","title":"Weight"},"reasoning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning"}},"type":"object","required":["event_name","category","weight"],"title":"ClassifiedEvent"},"ClassifyRequest":{"properties":{"product_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Description"},"answers":{"additionalProperties":true,"type":"object","title":"Answers"},"llm_response_raw":{"type":"string","minLength":20,"title":"Llm Response Raw"}},"type":"object","required":["llm_response_raw"],"title":"ClassifyRequest"},"ClassifyResponse":{"properties":{"status":{"type":"string","title":"Status"},"classified_event_count":{"type":"integer","title":"Classified Event Count"}},"type":"object","required":["status","classified_event_count"],"title":"ClassifyResponse"},"CodeExchangeRequest":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"CodeExchangeRequest"},"CohortCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"rules":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rules"}},"type":"object","required":["name"],"title":"CohortCreate"},"CohortResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"rules":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rules"},"is_default":{"type":"boolean","title":"Is Default","default":false},"customer_count":{"type":"integer","title":"Customer Count","default":0},"last_computed":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Computed"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","workspace_id","name","created_at"],"title":"CohortResponse"},"CohortUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"rules":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rules"}},"type":"object","title":"CohortUpdate"},"CommunicationItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"direction":{"type":"string","title":"Direction"},"from_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Email"},"from_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Name"},"to_emails":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"To Emails"},"inbox":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbox"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body_plain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Plain"},"snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snippet"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"is_bug_report":{"type":"boolean","title":"Is Bug Report"},"message_ts":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Message Ts"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"opened":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Opened"},"first_opened_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Opened At"},"reply_received":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Reply Received"},"reply_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reply At"},"returned":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Returned"},"returned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Returned At"},"unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Unsubscribed"},"unsubscribed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Unsubscribed At"},"undelivered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Undelivered"},"undelivered_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Undelivered Reason"}},"type":"object","required":["id","direction","from_email","from_name","to_emails","inbox","subject","body_plain","snippet","sentiment","summary","is_bug_report","message_ts"],"title":"CommunicationItem"},"ContextItemIn":{"properties":{"bucket":{"type":"string","pattern":"^(knowledge|guidance)$","title":"Bucket"},"title":{"type":"string","maxLength":300,"minLength":1,"title":"Title"},"content":{"type":"string","maxLength":20000,"minLength":1,"title":"Content"},"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"}},"type":"object","required":["bucket","title","content"],"title":"ContextItemIn"},"ContextItemPatch":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":300,"minLength":1},{"type":"null"}],"title":"Title"},"content":{"anyOf":[{"type":"string","maxLength":20000,"minLength":1},{"type":"null"}],"title":"Content"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"ContextItemPatch"},"CopilotMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"CopilotMessage"},"CopilotTurnRequest":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/CopilotMessage"},"type":"array","maxItems":60,"minItems":1,"title":"Messages"},"turn_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Turn Id"},"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"}},"type":"object","required":["messages"],"title":"CopilotTurnRequest"},"CopyVariant":{"properties":{"condition":{"anyOf":[{"$ref":"#/components/schemas/GateCondition"},{"type":"null"}]},"subject":{"type":"string","title":"Subject","default":""},"body":{"type":"string","title":"Body","default":""},"format":{"type":"string","enum":["text","html"],"title":"Format","default":"text"}},"type":"object","title":"CopyVariant","description":"One template-mode copy variant: optional condition + exact subject/body. The first\nvariant whose condition holds is sent; an unconditional variant is the default."},"CustomerCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"handle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handle"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"plan_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Name"},"mrr_cents":{"type":"integer","title":"Mrr Cents","default":0},"signup_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Signup Date"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"primary_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Channel"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["name","email"],"title":"CustomerCreate"},"CustomerFactsData":{"properties":{"facts":{"items":{"$ref":"#/components/schemas/FactOut"},"type":"array","title":"Facts"},"counts_by_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts By Type"}},"type":"object","required":["facts","counts_by_type"],"title":"CustomerFactsData"},"CustomerImportResult":{"properties":{"imported":{"type":"integer","title":"Imported"},"skipped":{"type":"integer","title":"Skipped"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","required":["imported","skipped","errors"],"title":"CustomerImportResult"},"CustomerListResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"plan_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Name"},"mrr_cents":{"type":"integer","title":"Mrr Cents","default":0},"revenue_30d_cents":{"type":"integer","title":"Revenue 30D Cents","default":0},"signup_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Signup Date"},"last_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Seen At"},"health":{"type":"string","title":"Health"},"churn_risk":{"type":"number","title":"Churn Risk"},"churn_risk_computed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Churn Risk Computed At"},"lifecycle_stage":{"type":"string","title":"Lifecycle Stage"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"primary_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Channel"},"actions_30d":{"type":"integer","title":"Actions 30D","default":0},"activity_14d":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Activity 14D"},"last_activity_event":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Activity Event"},"last_activity_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Activity At"},"signal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signal"},"bug_report_count":{"type":"integer","title":"Bug Report Count","default":0},"enrichment_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Enrichment Data"},"enriched_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Enriched At"},"posthog_properties":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Posthog Properties"},"posthog_location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posthog Location"},"stripe_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Stripe Data"},"revenuecat_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Revenuecat Data"}},"type":"object","required":["id","name","email","health","churn_risk","lifecycle_stage"],"title":"CustomerListResponse"},"CustomerResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"handle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handle"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"plan_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Name"},"mrr_cents":{"type":"integer","title":"Mrr Cents","default":0},"revenue_30d_cents":{"type":"integer","title":"Revenue 30D Cents","default":0},"signup_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Signup Date"},"last_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Seen At"},"health":{"type":"string","title":"Health"},"churn_risk":{"type":"number","title":"Churn Risk"},"lifecycle_stage":{"type":"string","title":"Lifecycle Stage"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"primary_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Channel"},"actions_30d":{"type":"integer","title":"Actions 30D","default":0},"activity_14d":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Activity 14D"},"last_activity_event":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Activity Event"},"last_activity_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Activity At"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"signal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signal"},"bug_report_count":{"type":"integer","title":"Bug Report Count","default":0},"outreach_reply_rate":{"type":"number","title":"Outreach Reply Rate","default":0.0},"last_open_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Open At"},"posthog_properties":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Posthog Properties"},"posthog_location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posthog Location"},"stripe_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Stripe Data"},"revenuecat_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Revenuecat Data"},"enrichment_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Enrichment Data"},"derived_properties":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Derived Properties"},"enriched_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Enriched At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","workspace_id","name","email","health","churn_risk","lifecycle_stage","created_at","updated_at"],"title":"CustomerResponse"},"CustomerUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"handle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handle"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"plan_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Name"},"mrr_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mrr Cents"},"lifecycle_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifecycle Stage"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"primary_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Channel"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"signal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signal"}},"type":"object","title":"CustomerUpdate"},"CustomersSection":{"properties":{"total":{"type":"integer","title":"Total","default":0},"health_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Health Distribution"},"signup_date_missing":{"type":"integer","title":"Signup Date Missing","default":0},"created_per_day_14d":{"additionalProperties":{"type":"integer"},"type":"object","title":"Created Per Day 14D"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"CustomersSection"},"DigestCreate":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"hour":{"type":"integer","maximum":23.0,"minimum":0.0,"title":"Hour","default":17},"minute":{"type":"integer","maximum":59.0,"minimum":0.0,"title":"Minute","default":0},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"enabled":{"type":"boolean","title":"Enabled","default":true},"custom_instructions":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Custom Instructions"},"include_followups":{"type":"boolean","title":"Include Followups","default":false}},"type":"object","required":["name"],"title":"DigestCreate"},"DigestData":{"properties":{"since":{"type":"string","format":"date-time","title":"Since"},"facts":{"items":{"$ref":"#/components/schemas/DigestFactOut"},"type":"array","title":"Facts"},"counts_by_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts By Type"}},"type":"object","required":["since","facts","counts_by_type"],"title":"DigestData"},"DigestFactOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"customer_id":{"type":"string","format":"uuid","title":"Customer Id"},"fact_type":{"type":"string","title":"Fact Type"},"text":{"type":"string","title":"Text"},"source_channel":{"type":"string","title":"Source Channel"},"source_message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Message Id"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"status":{"type":"string","title":"Status"},"occurrences":{"type":"integer","title":"Occurrences"},"first_seen_at":{"type":"string","format":"date-time","title":"First Seen At"},"last_seen_at":{"type":"string","format":"date-time","title":"Last Seen At"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"customer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Email"}},"type":"object","required":["id","customer_id","fact_type","text","source_channel","source_message_id","confidence","status","occurrences","first_seen_at","last_seen_at"],"title":"DigestFactOut"},"DigestResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"hour":{"type":"integer","title":"Hour"},"minute":{"type":"integer","title":"Minute"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"enabled":{"type":"boolean","title":"Enabled"},"custom_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Instructions"},"include_followups":{"type":"boolean","title":"Include Followups"},"last_posted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Posted At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"agents":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Agents"}},"type":"object","required":["id","workspace_id","name","hour","minute","timezone","enabled","custom_instructions","include_followups","last_posted_at","created_at"],"title":"DigestResponse"},"DigestUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":120,"minLength":1},{"type":"null"}],"title":"Name"},"hour":{"anyOf":[{"type":"integer","maximum":23.0,"minimum":0.0},{"type":"null"}],"title":"Hour"},"minute":{"anyOf":[{"type":"integer","maximum":59.0,"minimum":0.0},{"type":"null"}],"title":"Minute"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"custom_instructions":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Custom Instructions"},"include_followups":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Followups"}},"type":"object","title":"DigestUpdate"},"DirectSendCreate":{"properties":{"label":{"type":"string","maxLength":255,"minLength":1,"title":"Label"},"prompt":{"type":"string","minLength":1,"title":"Prompt"},"channel":{"type":"string","enum":["email","push"],"title":"Channel","default":"email"},"audience":{"$ref":"#/components/schemas/AudienceSpec"},"sender_display_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Sender Display Name"},"sender_from_email":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Sender From Email"},"sender_reply_to":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Sender Reply To"}},"type":"object","required":["label","prompt","audience"],"title":"DirectSendCreate"},"DiscordApprovalChannelRequest":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"channel_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Name"},"guild_id":{"type":"string","title":"Guild Id"},"guild_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guild Name"}},"type":"object","required":["channel_id","guild_id"],"title":"DiscordApprovalChannelRequest"},"DismissProposalRequest":{"properties":{"reason":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Reason"}},"type":"object","title":"DismissProposalRequest","description":"Dismiss-time: why, in the founder's own words. Optional — requiring it would\nadd friction to the primary action, and an uncaptured dismissal is worse than a\nreasonless one. Stored verbatim; it is the only record of why a suggestion was\nrefused, and the thing that stops the system re-litigating a settled question."},"DraftGenerateRequest":{"properties":{"channel":{"type":"string","title":"Channel","default":"email"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"gmail_account":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gmail Account"},"mode":{"type":"string","enum":["agent","campaign","say_thanks"],"title":"Mode","default":"agent"}},"type":"object","title":"DraftGenerateRequest"},"DraftResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"customer_id":{"type":"string","format":"uuid","title":"Customer Id"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body":{"type":"string","title":"Body"},"body_format":{"type":"string","title":"Body Format","default":"text"},"status":{"type":"string","title":"Status"},"content_version":{"type":"integer","title":"Content Version","default":1},"generation_context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Generation Context"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"reply_received":{"type":"boolean","title":"Reply Received","default":false},"reply_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reply At"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"customer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Email"},"priority_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority Tier"},"priority_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Priority Score"},"opened":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Opened"},"first_opened_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Opened At"},"unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Unsubscribed"},"unsubscribed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Unsubscribed At"},"returned":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Returned"},"returned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Returned At"}},"type":"object","required":["id","workspace_id","customer_id","body","status","generated_at"],"title":"DraftResponse"},"DraftRewriteRequest":{"properties":{"body":{"type":"string","title":"Body"},"instruction":{"type":"string","title":"Instruction"}},"type":"object","required":["body","instruction"],"title":"DraftRewriteRequest"},"DraftSendRequest":{"properties":{"campaign_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Id"},"campaign_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Label"}},"type":"object","title":"DraftSendRequest"},"DraftUpdate":{"properties":{"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"base_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Base Version"}},"type":"object","title":"DraftUpdate"},"EmailMatchPreview":{"properties":{"total_emails":{"type":"integer","title":"Total Emails"},"invalid":{"type":"integer","title":"Invalid"},"dropped":{"type":"integer","title":"Dropped"},"matched_pool":{"type":"integer","title":"Matched Pool"},"already_imported":{"type":"integer","title":"Already Imported"},"to_import":{"type":"integer","title":"To Import"},"unmatched":{"type":"integer","title":"Unmatched"},"matched_emails":{"items":{"type":"string"},"type":"array","title":"Matched Emails"},"sample_unmatched":{"items":{"type":"string"},"type":"array","title":"Sample Unmatched"}},"type":"object","required":["total_emails","invalid","dropped","matched_pool","already_imported","to_import","unmatched","matched_emails","sample_unmatched"],"title":"EmailMatchPreview","description":"Result of matching uploaded emails against the workspace's PostHog pool.\n\n`matched_emails` is the de-duplicated set of emails confirmed present in\nPostHog and not already imported; the confirm step imports exactly these,\nso PostHog is only queried once per flow (at preview time)."},"EmailMatchRequest":{"properties":{"emails":{"items":{"type":"string"},"type":"array","title":"Emails"}},"type":"object","required":["emails"],"title":"EmailMatchRequest","description":"Emails parsed from an uploaded CSV, to match against the PostHog pool."},"EnrichmentBuckets":{"properties":{"high":{"type":"integer","title":"High","default":0},"good":{"type":"integer","title":"Good","default":0},"fair":{"type":"integer","title":"Fair","default":0},"low":{"type":"integer","title":"Low","default":0}},"type":"object","title":"EnrichmentBuckets"},"EnrichmentSection":{"properties":{"auto_enrich":{"type":"boolean","title":"Auto Enrich","default":false},"total_customers":{"type":"integer","title":"Total Customers","default":0},"enriched_customers":{"type":"integer","title":"Enriched Customers","default":0},"confidence_buckets":{"additionalProperties":{"type":"integer"},"type":"object","title":"Confidence Buckets"},"latency_hours_p50":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency Hours P50"},"latency_hours_p90":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency Hours P90"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"EnrichmentSection"},"EnrichmentStats":{"properties":{"total":{"type":"integer","title":"Total","default":0},"enriched":{"type":"integer","title":"Enriched","default":0},"buckets":{"$ref":"#/components/schemas/EnrichmentBuckets","default":{"high":0,"good":0,"fair":0,"low":0}}},"type":"object","title":"EnrichmentStats","description":"Workspace-wide enrichment coverage (not the loaded page sample)."},"Envelope_ActivityEventsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ActivityEventsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ActivityEventsResponse]"},"Envelope_AgentDryRunResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AgentDryRunResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[AgentDryRunResponse]"},"Envelope_AgentFeedbackSummary_":{"properties":{"data":{"$ref":"#/components/schemas/AgentFeedbackSummary"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[AgentFeedbackSummary]"},"Envelope_AgentIntersectionsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AgentIntersectionsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[AgentIntersectionsResponse]"},"Envelope_AgentPreviewResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AgentPreviewResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[AgentPreviewResponse]"},"Envelope_AgentRefineResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AgentRefineResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[AgentRefineResponse]"},"Envelope_AgentResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AgentResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[AgentResponse]"},"Envelope_AudienceStatusResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AudienceStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[AudienceStatusResponse]"},"Envelope_AuthResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AuthResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[AuthResponse]"},"Envelope_AutosendSendResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AutosendSendResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[AutosendSendResponse]"},"Envelope_BacktestReport_":{"properties":{"data":{"$ref":"#/components/schemas/BacktestReport"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BacktestReport]"},"Envelope_BotAgentActionResult_":{"properties":{"data":{"$ref":"#/components/schemas/BotAgentActionResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BotAgentActionResult]"},"Envelope_BotAnswerResult_":{"properties":{"data":{"$ref":"#/components/schemas/BotAnswerResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BotAnswerResult]"},"Envelope_BotBriefingResult_":{"properties":{"data":{"$ref":"#/components/schemas/BotBriefingResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BotBriefingResult]"},"Envelope_BotDraftActionResult_":{"properties":{"data":{"$ref":"#/components/schemas/BotDraftActionResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BotDraftActionResult]"},"Envelope_BotDraftDetail_":{"properties":{"data":{"$ref":"#/components/schemas/BotDraftDetail"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BotDraftDetail]"},"Envelope_BotIngestResult_":{"properties":{"data":{"$ref":"#/components/schemas/BotIngestResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BotIngestResult]"},"Envelope_BotInstallationResult_":{"properties":{"data":{"$ref":"#/components/schemas/BotInstallationResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BotInstallationResult]"},"Envelope_BotLinkResult_":{"properties":{"data":{"$ref":"#/components/schemas/BotLinkResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BotLinkResult]"},"Envelope_BotSwitchResult_":{"properties":{"data":{"$ref":"#/components/schemas/BotSwitchResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BotSwitchResult]"},"Envelope_BotWorkspacesResult_":{"properties":{"data":{"$ref":"#/components/schemas/BotWorkspacesResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BotWorkspacesResult]"},"Envelope_BroadcastResponse_":{"properties":{"data":{"$ref":"#/components/schemas/BroadcastResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BroadcastResponse]"},"Envelope_BroadcastStatusResponse_":{"properties":{"data":{"$ref":"#/components/schemas/BroadcastStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BroadcastStatusResponse]"},"Envelope_BugFileResponse_":{"properties":{"data":{"$ref":"#/components/schemas/BugFileResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BugFileResponse]"},"Envelope_BugResponse_":{"properties":{"data":{"$ref":"#/components/schemas/BugResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BugResponse]"},"Envelope_BulkActionResult_":{"properties":{"data":{"$ref":"#/components/schemas/BulkActionResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[BulkActionResult]"},"Envelope_ChatMessageResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ChatMessageResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ChatMessageResponse]"},"Envelope_ChatThreadResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ChatThreadResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ChatThreadResponse]"},"Envelope_ChurnDistribution_":{"properties":{"data":{"$ref":"#/components/schemas/ChurnDistribution"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ChurnDistribution]"},"Envelope_ChurnReadyResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ChurnReadyResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ChurnReadyResponse]"},"Envelope_ClassificationPromptResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ClassificationPromptResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ClassificationPromptResponse]"},"Envelope_ClassificationStatusResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ClassificationStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ClassificationStatusResponse]"},"Envelope_ClassifyResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ClassifyResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ClassifyResponse]"},"Envelope_CohortResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CohortResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[CohortResponse]"},"Envelope_CustomerFactsData_":{"properties":{"data":{"$ref":"#/components/schemas/CustomerFactsData"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[CustomerFactsData]"},"Envelope_CustomerImportResult_":{"properties":{"data":{"$ref":"#/components/schemas/CustomerImportResult"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[CustomerImportResult]"},"Envelope_CustomerResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CustomerResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[CustomerResponse]"},"Envelope_DigestData_":{"properties":{"data":{"$ref":"#/components/schemas/DigestData"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[DigestData]"},"Envelope_DigestResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DigestResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[DigestResponse]"},"Envelope_DraftResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DraftResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[DraftResponse]"},"Envelope_EmailMatchPreview_":{"properties":{"data":{"$ref":"#/components/schemas/EmailMatchPreview"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[EmailMatchPreview]"},"Envelope_EnrichmentStats_":{"properties":{"data":{"$ref":"#/components/schemas/EnrichmentStats"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[EnrichmentStats]"},"Envelope_ExperimentDetail_":{"properties":{"data":{"$ref":"#/components/schemas/ExperimentDetail"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ExperimentDetail]"},"Envelope_ExperimentFieldsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ExperimentFieldsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ExperimentFieldsResponse]"},"Envelope_ExperimentResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ExperimentResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ExperimentResponse]"},"Envelope_FactOut_":{"properties":{"data":{"$ref":"#/components/schemas/FactOut"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[FactOut]"},"Envelope_FilterCountResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FilterCountResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[FilterCountResponse]"},"Envelope_FollowUpDraftResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FollowUpDraftResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[FollowUpDraftResponse]"},"Envelope_FollowUpList_":{"properties":{"data":{"$ref":"#/components/schemas/FollowUpList"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[FollowUpList]"},"Envelope_GmailAuthUrlResponse_":{"properties":{"data":{"$ref":"#/components/schemas/GmailAuthUrlResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[GmailAuthUrlResponse]"},"Envelope_GmailCallbackResponse_":{"properties":{"data":{"$ref":"#/components/schemas/GmailCallbackResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[GmailCallbackResponse]"},"Envelope_GmailSendResponse_":{"properties":{"data":{"$ref":"#/components/schemas/GmailSendResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[GmailSendResponse]"},"Envelope_HealthSummary_":{"properties":{"data":{"$ref":"#/components/schemas/HealthSummary"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[HealthSummary]"},"Envelope_ICPSummary_":{"properties":{"data":{"$ref":"#/components/schemas/ICPSummary"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ICPSummary]"},"Envelope_InboundDomainState_":{"properties":{"data":{"$ref":"#/components/schemas/InboundDomainState"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[InboundDomainState]"},"Envelope_IntegrationResponse_":{"properties":{"data":{"$ref":"#/components/schemas/IntegrationResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[IntegrationResponse]"},"Envelope_InviteAcceptResponse_":{"properties":{"data":{"$ref":"#/components/schemas/InviteAcceptResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[InviteAcceptResponse]"},"Envelope_InvitePreview_":{"properties":{"data":{"$ref":"#/components/schemas/InvitePreview"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[InvitePreview]"},"Envelope_InviteResponse_":{"properties":{"data":{"$ref":"#/components/schemas/InviteResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[InviteResponse]"},"Envelope_LifecycleSummary_":{"properties":{"data":{"$ref":"#/components/schemas/LifecycleSummary"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[LifecycleSummary]"},"Envelope_MasterMessageResponse_":{"properties":{"data":{"$ref":"#/components/schemas/MasterMessageResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[MasterMessageResponse]"},"Envelope_MasterStateResponse_":{"properties":{"data":{"$ref":"#/components/schemas/MasterStateResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[MasterStateResponse]"},"Envelope_MeResponse_":{"properties":{"data":{"$ref":"#/components/schemas/MeResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[MeResponse]"},"Envelope_MemberResponse_":{"properties":{"data":{"$ref":"#/components/schemas/MemberResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[MemberResponse]"},"Envelope_MrrTimeline_":{"properties":{"data":{"$ref":"#/components/schemas/MrrTimeline"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[MrrTimeline]"},"Envelope_ObjectiveResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ObjectiveResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ObjectiveResponse]"},"Envelope_PreflightReport_":{"properties":{"data":{"$ref":"#/components/schemas/PreflightReport"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[PreflightReport]"},"Envelope_PushReachabilitySummary_":{"properties":{"data":{"$ref":"#/components/schemas/PushReachabilitySummary"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[PushReachabilitySummary]"},"Envelope_ResendSendResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ResendSendResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[ResendSendResponse]"},"Envelope_RevenueSummaryResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RevenueSummaryResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[RevenueSummaryResponse]"},"Envelope_SavedFiltersResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SavedFiltersResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[SavedFiltersResponse]"},"Envelope_SubscriptionOptionsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SubscriptionOptionsResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[SubscriptionOptionsResponse]"},"Envelope_SuggestTriggerResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SuggestTriggerResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[SuggestTriggerResponse]"},"Envelope_SuggestViewResponse_":{"properties":{"data":{"$ref":"#/components/schemas/SuggestViewResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[SuggestViewResponse]"},"Envelope_Union_DraftResponse__NoneType__":{"properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/DraftResponse"},{"type":"null"}]},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[Union[DraftResponse, NoneType]]"},"Envelope_Union_IntegrationResponse__NoneType__":{"properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/IntegrationResponse"},{"type":"null"}]},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[Union[IntegrationResponse, NoneType]]"},"Envelope_Union_dict__NoneType__":{"properties":{"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[Union[dict, NoneType]]"},"Envelope_UsersByEventResponse_":{"properties":{"data":{"$ref":"#/components/schemas/UsersByEventResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[UsersByEventResponse]"},"Envelope_WidgetResponse_":{"properties":{"data":{"$ref":"#/components/schemas/WidgetResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[WidgetResponse]"},"Envelope_WorkspaceInventory_":{"properties":{"data":{"$ref":"#/components/schemas/WorkspaceInventory"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[WorkspaceInventory]"},"Envelope_WorkspaceResponse_":{"properties":{"data":{"$ref":"#/components/schemas/WorkspaceResponse"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[WorkspaceResponse]"},"Envelope_dict_":{"properties":{"data":{"additionalProperties":true,"type":"object","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[dict]"},"Envelope_dict_str__AgentDraftCounts__":{"properties":{"data":{"additionalProperties":{"$ref":"#/components/schemas/AgentDraftCounts"},"type":"object","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[dict[str, AgentDraftCounts]]"},"Envelope_dict_str__list_dict___":{"properties":{"data":{"additionalProperties":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"type":"object","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[dict[str, list[dict]]]"},"Envelope_list_":{"properties":{"data":{"items":{},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list]"},"Envelope_list_AgentPollLogResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AgentPollLogResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[AgentPollLogResponse]]"},"Envelope_list_AgentProposalResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AgentProposalResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[AgentProposalResponse]]"},"Envelope_list_AgentResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AgentResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[AgentResponse]]"},"Envelope_list_ChatMessageResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ChatMessageResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[ChatMessageResponse]]"},"Envelope_list_ClassifiedEvent__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ClassifiedEvent"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[ClassifiedEvent]]"},"Envelope_list_CommunicationItem__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CommunicationItem"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[CommunicationItem]]"},"Envelope_list_DigestResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/DigestResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[DigestResponse]]"},"Envelope_list_DraftResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/DraftResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[DraftResponse]]"},"Envelope_list_EscalationOut__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/EscalationOut"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[EscalationOut]]"},"Envelope_list_ExperimentListItem__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ExperimentListItem"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[ExperimentListItem]]"},"Envelope_list_GmailThreadMessage__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/GmailThreadMessage"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[GmailThreadMessage]]"},"Envelope_list_ICPPattern__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ICPPattern"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[ICPPattern]]"},"Envelope_list_IntegrationResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/IntegrationResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[IntegrationResponse]]"},"Envelope_list_InviteResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/InviteResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[InviteResponse]]"},"Envelope_list_MasterActionResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/MasterActionResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[MasterActionResponse]]"},"Envelope_list_MasterMessageResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/MasterMessageResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[MasterMessageResponse]]"},"Envelope_list_MasterRunResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/MasterRunResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[MasterRunResponse]]"},"Envelope_list_MemberResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/MemberResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[MemberResponse]]"},"Envelope_list_ObjectiveResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ObjectiveResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[ObjectiveResponse]]"},"Envelope_list_OutreachHistoryResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/OutreachHistoryResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[OutreachHistoryResponse]]"},"Envelope_list_TopUser__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/TopUser"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[TopUser]]"},"Envelope_list_WidgetResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WidgetResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[WidgetResponse]]"},"Envelope_list_WorkspaceResponse__":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WorkspaceResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[WorkspaceResponse]]"},"Envelope_list_dict__":{"properties":{"data":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[dict]]"},"Envelope_list_str__":{"properties":{"data":{"items":{"type":"string"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/Meta","default":{"request_id":"","timestamp":"2026-09-02T06:27:06.745467"}}},"type":"object","required":["data"],"title":"Envelope[list[str]]"},"EscalationOut":{"properties":{"draft_id":{"type":"string","format":"uuid","title":"Draft Id"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"customer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Email"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"category_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Label"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"escalated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Escalated At"}},"type":"object","required":["draft_id","customer_id","customer_name","customer_email","category","category_label","reason","subject","body","escalated_at"],"title":"EscalationOut"},"EventCatalogEntry":{"properties":{"name":{"type":"string","title":"Name"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["name","count"],"title":"EventCatalogEntry"},"EventsSection":{"properties":{"connected":{"type":"boolean","title":"Connected","default":false},"events":{"items":{"$ref":"#/components/schemas/EventCatalogEntry"},"type":"array","title":"Events"},"total_events":{"type":"integer","title":"Total Events","default":0},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"EventsSection"},"ExistingAgentSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"trigger_source":{"type":"string","title":"Trigger Source"},"event_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Name"},"delivery_mode":{"type":"string","title":"Delivery Mode"},"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["id","name","trigger_source","delivery_mode","enabled"],"title":"ExistingAgentSummary"},"ExperimentCreate":{"properties":{"name":{"type":"string","maxLength":160,"minLength":1,"title":"Name"},"variants":{"items":{"$ref":"#/components/schemas/VariantCreate"},"type":"array","minItems":2,"title":"Variants"},"varies":{"items":{"type":"string"},"type":"array","title":"Varies"},"window_hours":{"anyOf":[{"type":"integer","maximum":720.0,"minimum":1.0},{"type":"null"}],"title":"Window Hours"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"parent_experiment_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Experiment Id"}},"type":"object","required":["name","variants"],"title":"ExperimentCreate"},"ExperimentDetail":{"properties":{"experiment":{"$ref":"#/components/schemas/ExperimentResponse"},"variants":{"items":{"$ref":"#/components/schemas/VariantSummary"},"type":"array","title":"Variants"},"control_variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Control Variant Id"},"winner_variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Winner Variant Id"},"leader_variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Leader Variant Id"},"conclusive":{"type":"boolean","title":"Conclusive"},"alpha":{"type":"number","title":"Alpha"},"comparisons":{"type":"integer","title":"Comparisons"},"min_matured_for_rate":{"type":"integer","title":"Min Matured For Rate"},"required_n_for_observed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Required N For Observed"},"required_n_for_5pt":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Required N For 5Pt"},"organic_baseline":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Organic Baseline"},"runs_per_day":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Runs Per Day"}},"type":"object","required":["experiment","variants","control_variant_id","winner_variant_id","leader_variant_id","conclusive","alpha","comparisons","min_matured_for_rate","required_n_for_observed","required_n_for_5pt","organic_baseline","runs_per_day"],"title":"ExperimentDetail"},"ExperimentFieldsResponse":{"properties":{"variable_fields":{"items":{"type":"string"},"type":"array","title":"Variable Fields"},"locked_fields":{"items":{"type":"string"},"type":"array","title":"Locked Fields"},"field_kinds":{"additionalProperties":{"type":"string"},"type":"object","title":"Field Kinds"},"gmail_accounts":{"items":{"type":"string"},"type":"array","title":"Gmail Accounts"},"current":{"additionalProperties":true,"type":"object","title":"Current"},"default_window_hours":{"type":"integer","title":"Default Window Hours"}},"type":"object","required":["variable_fields","locked_fields","field_kinds","gmail_accounts","current","default_window_hours"],"title":"ExperimentFieldsResponse","description":"What the builder is allowed to offer, straight from the server's allow list, so the\nUI can never present a field the API would refuse."},"ExperimentListItem":{"properties":{"experiment":{"$ref":"#/components/schemas/ExperimentResponse"},"variants":{"items":{"$ref":"#/components/schemas/VariantSummary"},"type":"array","title":"Variants"},"winner_variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Winner Variant Id"},"conclusive":{"type":"boolean","title":"Conclusive"}},"type":"object","required":["experiment","variants","winner_variant_id","conclusive"],"title":"ExperimentListItem"},"ExperimentResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"varies":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Varies"},"window_hours":{"type":"integer","title":"Window Hours"},"base_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Base Config"},"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"},"promoted_variant_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Promoted Variant Id"},"parent_experiment_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Experiment Id"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","agent_id","name","status","varies","window_hours","base_config","started_at","ended_at","promoted_variant_id","parent_experiment_id","notes","created_at"],"title":"ExperimentResponse"},"FactOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"customer_id":{"type":"string","format":"uuid","title":"Customer Id"},"fact_type":{"type":"string","title":"Fact Type"},"text":{"type":"string","title":"Text"},"source_channel":{"type":"string","title":"Source Channel"},"source_message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Message Id"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"status":{"type":"string","title":"Status"},"occurrences":{"type":"integer","title":"Occurrences"},"first_seen_at":{"type":"string","format":"date-time","title":"First Seen At"},"last_seen_at":{"type":"string","format":"date-time","title":"Last Seen At"}},"type":"object","required":["id","customer_id","fact_type","text","source_channel","source_message_id","confidence","status","occurrences","first_seen_at","last_seen_at"],"title":"FactOut"},"FactStatusUpdate":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"FactStatusUpdate"},"FilterCountRequest":{"properties":{"filters":{"items":{"$ref":"#/components/schemas/app__routes__posthog__PropertyFilter"},"type":"array","title":"Filters"},"activity":{"anyOf":[{"$ref":"#/components/schemas/ActivityFilter"},{"type":"null"}]},"activity_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Activity Days"}},"type":"object","required":["filters"],"title":"FilterCountRequest"},"FilterCountResponse":{"properties":{"count":{"type":"integer","title":"Count"}},"type":"object","required":["count"],"title":"FilterCountResponse"},"FollowUpCustomer":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["id"],"title":"FollowUpCustomer"},"FollowUpDraftResponse":{"properties":{"draft_id":{"type":"string","format":"uuid","title":"Draft Id"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body":{"type":"string","title":"Body"}},"type":"object","required":["draft_id","body"],"title":"FollowUpDraftResponse"},"FollowUpItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"gmail_thread_id":{"type":"string","title":"Gmail Thread Id"},"customer":{"$ref":"#/components/schemas/FollowUpCustomer"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snippet"},"body_plain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Plain"},"internal_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Internal Date"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"urgency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urgency"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"is_reply":{"type":"boolean","title":"Is Reply","default":false},"replied_to_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replied To Subject"},"dismissed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dismissed At"},"responded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Responded At"},"response_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Body"},"response_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response From"},"draft_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Draft Id"},"draft_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Draft Subject"},"draft_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Draft Body"},"received_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Received On"},"status":{"type":"string","title":"Status","default":"open"},"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"opening_send_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Opening Send Subject"},"opening_send_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Opening Send Body"},"opening_send_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Opening Send At"}},"type":"object","required":["id","gmail_thread_id","customer"],"title":"FollowUpItem"},"FollowUpList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FollowUpItem"},"type":"array","title":"Items"},"open_count":{"type":"integer","title":"Open Count"},"dismissed_count":{"type":"integer","title":"Dismissed Count"},"responded_count":{"type":"integer","title":"Responded Count","default":0}},"type":"object","required":["items","open_count","dismissed_count"],"title":"FollowUpList"},"FollowUpReplyRequest":{"properties":{"body":{"type":"string","title":"Body"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"draft_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Draft Id"},"transport":{"type":"string","title":"Transport","default":"domain"},"from_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Name"}},"type":"object","required":["body"],"title":"FollowUpReplyRequest"},"FreshnessSection":{"properties":{"integration_last_synced":{"additionalProperties":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"type":"object","title":"Integration Last Synced"},"last_enrichment_finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Enrichment Finished At"},"oldest_customer_created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Oldest Customer Created At"},"days_of_history":{"type":"integer","title":"Days Of History","default":0},"thin_history":{"type":"boolean","title":"Thin History","default":false},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"FreshnessSection"},"GateCondition":{"properties":{"field":{"type":"string","title":"Field"},"operator":{"type":"string","title":"Operator"},"value":{"type":"string","title":"Value"}},"type":"object","required":["field","operator","value"],"title":"GateCondition","description":"A predicate on local customer state (see agent_query.GATE_FIELDS)."},"GmailAuthUrlResponse":{"properties":{"auth_url":{"type":"string","title":"Auth Url"},"state":{"type":"string","title":"State"}},"type":"object","required":["auth_url","state"],"title":"GmailAuthUrlResponse"},"GmailCallbackRequest":{"properties":{"code":{"type":"string","title":"Code"},"state":{"type":"string","title":"State"}},"type":"object","required":["code","state"],"title":"GmailCallbackRequest"},"GmailCallbackResponse":{"properties":{"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"integration_id":{"type":"string","format":"uuid","title":"Integration Id"}},"type":"object","required":["email","name","integration_id"],"title":"GmailCallbackResponse"},"GmailSendRequest":{"properties":{"from_account":{"type":"string","title":"From Account"},"to":{"type":"string","title":"To"},"subject":{"type":"string","title":"Subject"},"body_html":{"type":"string","title":"Body Html"},"body_plain":{"type":"string","title":"Body Plain"},"reply_to_gmail_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Reply To Gmail Message Id"},"draft_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Draft Id"}},"type":"object","required":["from_account","to","subject","body_html","body_plain"],"title":"GmailSendRequest"},"GmailSendResponse":{"properties":{"gmail_message_id":{"type":"string","title":"Gmail Message Id"},"gmail_thread_id":{"type":"string","title":"Gmail Thread Id"}},"type":"object","required":["gmail_message_id","gmail_thread_id"],"title":"GmailSendResponse"},"GmailThreadMessage":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"gmail_message_id":{"type":"string","title":"Gmail Message Id"},"direction":{"type":"string","title":"Direction"},"from_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Email"},"from_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Name"},"to_emails":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"To Emails"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body_plain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Plain"},"body_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Html"},"snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snippet"},"internal_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Internal Date"},"is_bug_report":{"type":"boolean","title":"Is Bug Report"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"urgency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urgency"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"}},"type":"object","required":["id","gmail_message_id","direction","from_email","from_name","to_emails","subject","body_plain","body_html","snippet","internal_date","is_bug_report","sentiment","urgency","summary"],"title":"GmailThreadMessage"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthSummary":{"properties":{"healthy_count":{"type":"integer","title":"Healthy Count","default":0},"healthy_pct":{"type":"number","title":"Healthy Pct","default":0.0},"healthy_delta":{"type":"integer","title":"Healthy Delta","default":0},"at_risk_count":{"type":"integer","title":"At Risk Count","default":0},"at_risk_pct":{"type":"number","title":"At Risk Pct","default":0.0},"at_risk_delta":{"type":"integer","title":"At Risk Delta","default":0},"near_churn_count":{"type":"integer","title":"Near Churn Count","default":0},"near_churn_pct":{"type":"number","title":"Near Churn Pct","default":0.0},"near_churn_delta":{"type":"integer","title":"Near Churn Delta","default":0},"total":{"type":"integer","title":"Total","default":0},"total_mrr_cents":{"type":"integer","title":"Total Mrr Cents","default":0},"at_risk_mrr_cents":{"type":"integer","title":"At Risk Mrr Cents","default":0},"near_churn_mrr_cents":{"type":"integer","title":"Near Churn Mrr Cents","default":0},"updated_at":{"type":"string","title":"Updated At","default":""}},"type":"object","title":"HealthSummary"},"ICPPattern":{"properties":{"trait":{"type":"string","title":"Trait"},"frequency":{"type":"number","title":"Frequency"},"description":{"type":"string","title":"Description"}},"type":"object","required":["trait","frequency","description"],"title":"ICPPattern"},"ICPSummary":{"properties":{"top_users":{"items":{"$ref":"#/components/schemas/TopUser"},"type":"array","title":"Top Users"},"patterns":{"items":{"$ref":"#/components/schemas/ICPPattern"},"type":"array","title":"Patterns"},"icp_sentence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icp Sentence"}},"type":"object","required":["top_users","patterns"],"title":"ICPSummary"},"InboundDomainCreate":{"properties":{"domain":{"type":"string","title":"Domain"},"forward_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Forward To"}},"type":"object","required":["domain"],"title":"InboundDomainCreate"},"InboundDomainState":{"properties":{"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"forward_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Forward To"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"ses_verification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ses Verification"},"dns_records":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Dns Records","default":[]},"suggested_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Domain"},"needs_activation_ack":{"type":"boolean","title":"Needs Activation Ack","default":false},"received_count":{"type":"integer","title":"Received Count","default":0}},"type":"object","title":"InboundDomainState"},"IntegrationConnectRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"credentials":{"additionalProperties":true,"type":"object","title":"Credentials"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"}},"type":"object","required":["provider","credentials"],"title":"IntegrationConnectRequest"},"IntegrationResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"provider":{"type":"string","title":"Provider"},"account_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Identifier"},"status":{"type":"string","title":"Status"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced At"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"connected_at":{"type":"string","format":"date-time","title":"Connected At"},"is_syncing":{"type":"boolean","title":"Is Syncing","default":false}},"type":"object","required":["id","workspace_id","provider","status","connected_at"],"title":"IntegrationResponse"},"InviteAcceptResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"workspace_name":{"type":"string","title":"Workspace Name"},"role":{"type":"string","title":"Role"}},"type":"object","required":["workspace_id","workspace_name","role"],"title":"InviteAcceptResponse"},"InviteCreate":{"properties":{"email":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Email","description":"Email to invite. Omit for a shareable link invite."},"role":{"type":"string","title":"Role","default":"member"}},"type":"object","title":"InviteCreate"},"InvitePreview":{"properties":{"workspace_name":{"type":"string","title":"Workspace Name"},"inviter_name":{"type":"string","title":"Inviter Name"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"is_expired":{"type":"boolean","title":"Is Expired"}},"type":"object","required":["workspace_name","inviter_name","expires_at","is_expired"],"title":"InvitePreview"},"InviteResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"role":{"type":"string","title":"Role"},"is_link_invite":{"type":"boolean","title":"Is Link Invite"},"token":{"type":"string","title":"Token"},"inviter_name":{"type":"string","title":"Inviter Name"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Used At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","workspace_id","email","role","is_link_invite","token","inviter_name","expires_at","created_at"],"title":"InviteResponse"},"LifecycleSummary":{"properties":{"trial":{"type":"integer","title":"Trial","default":0},"activating":{"type":"integer","title":"Activating","default":0},"active":{"type":"integer","title":"Active","default":0},"at_risk":{"type":"integer","title":"At Risk","default":0},"near_churn":{"type":"integer","title":"Near Churn","default":0}},"type":"object","title":"LifecycleSummary"},"LinkBody":{"properties":{"label":{"type":"string","title":"Label"},"url":{"type":"string","title":"Url"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["label","url"],"title":"LinkBody"},"LoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","minLength":1,"title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"MasterActionResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"run_id":{"type":"string","format":"uuid","title":"Run Id"},"objective_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Objective Id"},"tool_name":{"type":"string","title":"Tool Name"},"input":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"status":{"type":"string","title":"Status"},"refusal_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refusal Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","run_id","objective_id","tool_name","input","result","status","refusal_reason","created_at"],"title":"MasterActionResponse"},"MasterAutonomy":{"properties":{"can_create_agents":{"type":"boolean","title":"Can Create Agents","default":true},"can_modify_agents":{"type":"boolean","title":"Can Modify Agents","default":true},"can_pause_agents":{"type":"boolean","title":"Can Pause Agents","default":true},"can_approve_drafts":{"type":"boolean","title":"Can Approve Drafts","default":false},"max_draft_approvals_per_day":{"type":"integer","maximum":200.0,"minimum":0.0,"title":"Max Draft Approvals Per Day","default":10},"max_actions_per_tick":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Max Actions Per Tick","default":12}},"additionalProperties":false,"type":"object","title":"MasterAutonomy","description":"Founder-granted capabilities. Conservative defaults; unknown keys rejected\nso a typo can't silently grant nothing (or worse, be read as a wider grant\nby a future field of that name)."},"MasterChatBody":{"properties":{"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":60,"minItems":1,"title":"Messages"},"turn_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Turn Id"}},"type":"object","required":["messages"],"title":"MasterChatBody"},"MasterMessageResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"direction":{"type":"string","title":"Direction"},"kind":{"type":"string","title":"Kind"},"body":{"type":"string","title":"Body"},"objective_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Objective Id"},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"},"proposed_action":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Proposed Action"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"},"status":{"type":"string","title":"Status"},"response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response"},"responded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Responded At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","direction","kind","body","objective_id","run_id","proposed_action","severity","status","response","responded_at","created_at"],"title":"MasterMessageResponse"},"MasterRunResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"kind":{"type":"string","title":"Kind"},"status":{"type":"string","title":"Status"},"objective_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Objective Id"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"},"stats":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Stats"}},"type":"object","required":["id","kind","status","objective_id","summary","error","started_at","finished_at","stats"],"title":"MasterRunResponse"},"MasterStateResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"enabled":{"type":"boolean","title":"Enabled"},"autonomy":{"$ref":"#/components/schemas/MasterAutonomy"},"memory":{"items":{"type":"string"},"type":"array","title":"Memory"},"tick_interval_minutes":{"type":"integer","title":"Tick Interval Minutes"},"last_tick_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Tick At"}},"type":"object","required":["workspace_id","enabled","autonomy","memory","tick_interval_minutes","last_tick_at"],"title":"MasterStateResponse"},"MasterStateUpdate":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"autonomy":{"anyOf":[{"$ref":"#/components/schemas/MasterAutonomy"},{"type":"null"}]},"tick_interval_minutes":{"anyOf":[{"type":"integer","maximum":10080.0,"minimum":15.0},{"type":"null"}],"title":"Tick Interval Minutes"}},"type":"object","title":"MasterStateUpdate"},"MeResponse":{"properties":{"user":{"$ref":"#/components/schemas/UserResponse"},"workspaces":{"items":{"$ref":"#/components/schemas/WorkspaceMembershipResponse"},"type":"array","title":"Workspaces"},"active_workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Active Workspace Id"}},"type":"object","required":["user","workspaces"],"title":"MeResponse"},"MemberInvite":{"properties":{"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role","default":"member"}},"type":"object","required":["email"],"title":"MemberInvite"},"MemberResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"user_email":{"type":"string","title":"User Email"},"user_name":{"type":"string","title":"User Name"},"role":{"type":"string","title":"Role"},"joined_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Joined At"}},"type":"object","required":["id","user_id","user_email","user_name","role","joined_at"],"title":"MemberResponse"},"MessageRespondBody":{"properties":{"decision":{"type":"string","enum":["approve","deny","answer","acknowledge"],"title":"Decision"},"response":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Response"}},"type":"object","required":["decision"],"title":"MessageRespondBody"},"Meta":{"properties":{"request_id":{"type":"string","title":"Request Id","default":""},"timestamp":{"type":"string","format":"date-time","title":"Timestamp","default":"2026-09-02T06:27:06.745467"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"truncated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Truncated"}},"type":"object","title":"Meta"},"MrrTimeline":{"properties":{"months":{"items":{"type":"string"},"type":"array","title":"Months","default":[]},"new_subscriptions":{"items":{"type":"integer"},"type":"array","title":"New Subscriptions","default":[]},"cancellations":{"items":{"type":"integer"},"type":"array","title":"Cancellations","default":[]},"new_mrr_cents":{"items":{"type":"integer"},"type":"array","title":"New Mrr Cents","default":[]}},"type":"object","title":"MrrTimeline"},"ObjectiveConfig":{"properties":{"max_agents":{"type":"integer","maximum":20.0,"minimum":0.0,"title":"Max Agents","default":3},"max_daily_sends":{"type":"integer","maximum":500.0,"minimum":0.0,"title":"Max Daily Sends","default":20},"allowed_delivery_modes":{"items":{"type":"string"},"type":"array","title":"Allowed Delivery Modes"}},"additionalProperties":false,"type":"object","title":"ObjectiveConfig","description":"Per-objective budgets enforced by the master's guardrail layer."},"ObjectiveCreate":{"properties":{"title":{"type":"string","maxLength":255,"minLength":1,"title":"Title"},"description":{"type":"string","minLength":1,"title":"Description"},"objective_type":{"type":"string","enum":["retention","feedback","winback","upgrade","activation","custom"],"title":"Objective Type","default":"custom"},"success_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Success Criteria"},"config":{"$ref":"#/components/schemas/ObjectiveConfig"},"priority":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Priority","default":3},"target_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Target Date"}},"type":"object","required":["title","description"],"title":"ObjectiveCreate"},"ObjectiveResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"objective_type":{"type":"string","title":"Objective Type"},"status":{"type":"string","title":"Status"},"success_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Success Criteria"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"priority":{"type":"integer","title":"Priority"},"target_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Target Date"},"metrics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metrics"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","title","description","objective_type","status","success_criteria","config","priority","target_date","metrics","created_by","created_at","updated_at"],"title":"ObjectiveResponse"},"ObjectiveUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"anyOf":[{"type":"string","enum":["active","paused","completed","archived"]},{"type":"null"}],"title":"Status"},"success_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Success Criteria"},"config":{"anyOf":[{"$ref":"#/components/schemas/ObjectiveConfig"},{"type":"null"}]},"priority":{"anyOf":[{"type":"integer","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Priority"},"target_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Target Date"}},"type":"object","title":"ObjectiveUpdate"},"OutreachHistoryResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"channel":{"type":"string","title":"Channel"},"direction":{"type":"string","title":"Direction"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"content_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Preview"},"campaign_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Id"},"campaign_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Label"},"message_ts":{"type":"string","format":"date-time","title":"Message Ts"}},"type":"object","required":["id","channel","direction","message_ts"],"title":"OutreachHistoryResponse"},"PaginatedEnvelope_AgentRunResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AgentRunResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"type":"object","required":["data","meta"],"title":"PaginatedEnvelope[AgentRunResponse]"},"PaginatedEnvelope_BugResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/BugResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"type":"object","required":["data","meta"],"title":"PaginatedEnvelope[BugResponse]"},"PaginatedEnvelope_ChatThreadResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ChatThreadResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"type":"object","required":["data","meta"],"title":"PaginatedEnvelope[ChatThreadResponse]"},"PaginatedEnvelope_CohortResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CohortResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"type":"object","required":["data","meta"],"title":"PaginatedEnvelope[CohortResponse]"},"PaginatedEnvelope_CustomerListResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CustomerListResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"type":"object","required":["data","meta"],"title":"PaginatedEnvelope[CustomerListResponse]"},"PaginatedEnvelope_DraftResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/DraftResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"type":"object","required":["data","meta"],"title":"PaginatedEnvelope[DraftResponse]"},"PaginatedEnvelope_dict_":{"properties":{"data":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"type":"object","required":["data","meta"],"title":"PaginatedEnvelope[dict]"},"PaginationMeta":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"},"pages":{"type":"integer","title":"Pages"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More","default":false},"safe_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Safe Count"},"opened_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Opened Count"},"returned_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Returned Count"},"request_id":{"type":"string","title":"Request Id","default":""},"timestamp":{"type":"string","format":"date-time","title":"Timestamp","default":"2026-09-02T06:27:06.746479"}},"type":"object","required":["total","page","per_page","pages"],"title":"PaginationMeta"},"PersonPropertiesSection":{"properties":{"keys":{"items":{"type":"string"},"type":"array","title":"Keys"},"total_keys":{"type":"integer","title":"Total Keys","default":0},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"PersonPropertiesSection"},"PreflightCheck":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","enum":["pass","warn","fail"],"title":"Status"},"title":{"type":"string","title":"Title"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["id","status","title","detail"],"title":"PreflightCheck","description":"One machine-run assumption check. ``detail`` is plain English — it is\nshown verbatim to founders and fed verbatim to the copilot, so it must\nexplain the consequence, not just the fact (\"this property exists on 22%\nof trial users, so this agent will miss the other 78%\")."},"PreflightReport":{"properties":{"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"verdict":{"type":"string","enum":["pass","warn","fail"],"title":"Verdict"},"checks":{"items":{"$ref":"#/components/schemas/PreflightCheck"},"type":"array","title":"Checks"}},"type":"object","required":["generated_at","verdict","checks"],"title":"PreflightReport"},"ProductDescriptionRequest":{"properties":{"product_description":{"type":"string","title":"Product Description"}},"type":"object","required":["product_description"],"title":"ProductDescriptionRequest"},"ProfileUpdateBody":{"properties":{"custom_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Instructions"}},"type":"object","title":"ProfileUpdateBody"},"PromoteRequest":{"properties":{"variant_id":{"type":"string","format":"uuid","title":"Variant Id"},"start_next":{"type":"boolean","title":"Start Next","default":false},"force":{"type":"boolean","title":"Force","default":false}},"type":"object","required":["variant_id"],"title":"PromoteRequest"},"PubSubMessage":{"properties":{"data":{"type":"string","title":"Data"},"messageId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Messageid"},"publishTime":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publishtime"}},"type":"object","required":["data"],"title":"PubSubMessage"},"PubSubPush":{"properties":{"message":{"$ref":"#/components/schemas/PubSubMessage"},"subscription":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription"}},"type":"object","required":["message"],"title":"PubSubPush"},"PushReachabilitySummary":{"properties":{"cohort":{"type":"integer","title":"Cohort","default":0},"checked":{"type":"integer","title":"Checked","default":0},"reachable":{"type":"integer","title":"Reachable","default":0},"quiet":{"type":"integer","title":"Quiet","default":0},"lost":{"type":"integer","title":"Lost","default":0},"reachable_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reachable Pct"},"active_window_days":{"type":"integer","title":"Active Window Days","default":0}},"type":"object","title":"PushReachabilitySummary","description":"How much of the push audience can still receive a push.\n\nThree numbers rather than one percentage, because a bare rate hides the two\nthings that make it honest. `cohort` is the ACTIVELY-pushed audience (see\napp/jobs/push_reachability_sweep.py for why it cannot be the whole base), and\n`checked` is how many of them we have actually read - so the UI can say\n\"based on N of M\" instead of implying it measured everyone. `reachable_pct`\nis None when nothing has been read, so \"not reporting\" can never render as\na confident 0%."},"PushSendRequest":{"properties":{"override_hold":{"type":"boolean","title":"Override Hold","default":false}},"type":"object","title":"PushSendRequest","description":"``override_hold``: the reviewer read the copy and wants it sent over the\njudge's objection. Waives the LLM verdict only — the frequency cap, the\npartner's own device-level opt-outs and the mechanical unsendable guard all\nstill apply, and the override is recorded on the draft."},"RecipientFilters":{"properties":{"q":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"},"health":{"items":{"type":"string"},"type":"array","title":"Health"},"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"plan_names":{"items":{"type":"string"},"type":"array","title":"Plan Names"},"lifecycle_stages":{"items":{"type":"string"},"type":"array","title":"Lifecycle Stages"},"min_churn_risk":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Churn Risk"},"max_churn_risk":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Churn Risk"},"has_bug_reports":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Bug Reports"},"has_replied":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Replied"}},"type":"object","title":"RecipientFilters","description":"Recipient-side scoping for the agent review queue, shared by GET /drafts/page (query\nparams) and bulk-approve (``body.filters``) so 'the filtered view' means the same rows in\nboth places. Semantics mirror /customers: list fields match any value, churn band is min\ninclusive / max exclusive, booleans key off the denormalized counters, ``q`` searches the\nrecipient name/email."},"RedraftAllRequest":{"properties":{"exclude_draft_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":10,"title":"Exclude Draft Ids"}},"type":"object","title":"RedraftAllRequest"},"RedraftDraftRequest":{"properties":{"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"reason_tag":{"anyOf":[{"type":"string","enum":["too_long","wrong_tone","weak_opener","wrong_facts"]},{"type":"null"}],"title":"Reason Tag"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"},"scope":{"anyOf":[{"type":"string","enum":["this_draft","every_draft"]},{"type":"null"}],"title":"Scope"}},"type":"object","title":"RedraftDraftRequest"},"RefineReceipt":{"properties":{"quote":{"type":"string","title":"Quote"},"kind":{"type":"string","title":"Kind"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"draft_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Draft Id"},"actor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor"}},"type":"object","required":["quote","kind"],"title":"RefineReceipt","description":"Verbatim evidence behind a suggestion — the founder's own words/edits,\nbuilt deterministically from ledger rows (never LLM-authored)."},"RefreshRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshRequest"},"ResendSendRequest":{"properties":{"to":{"type":"string","title":"To"},"subject":{"type":"string","title":"Subject"},"body_html":{"type":"string","title":"Body Html"},"body_plain":{"type":"string","title":"Body Plain"},"reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reply To"},"draft_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Draft Id"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"}},"type":"object","required":["to","subject","body_html","body_plain"],"title":"ResendSendRequest"},"ResendSendResponse":{"properties":{"resend_message_id":{"type":"string","title":"Resend Message Id"}},"type":"object","required":["resend_message_id"],"title":"ResendSendResponse"},"ResolutionBody":{"properties":{"winner":{"type":"string","enum":["a","b"],"title":"Winner"}},"type":"object","required":["winner"],"title":"ResolutionBody"},"RevenueSummaryResponse":{"properties":{"total_mrr_cents":{"type":"integer","title":"Total Mrr Cents","default":0},"total_spent_cents":{"type":"integer","title":"Total Spent Cents","default":0},"paying_count":{"type":"integer","title":"Paying Count","default":0},"subscriber_count":{"type":"integer","title":"Subscriber Count","default":0},"cancelled_count":{"type":"integer","title":"Cancelled Count","default":0}},"type":"object","title":"RevenueSummaryResponse"},"RulesSection":{"properties":{"quiet_hours_enabled":{"type":"boolean","title":"Quiet Hours Enabled","default":false},"max_emails_per_24h":{"type":"integer","title":"Max Emails Per 24H","default":0},"max_push_per_24h":{"type":"integer","title":"Max Push Per 24H","default":0},"approval_card_cap":{"type":"integer","title":"Approval Card Cap","default":0},"digest_mode":{"type":"boolean","title":"Digest Mode","default":false},"computed_var_names":{"items":{"type":"string"},"type":"array","title":"Computed Var Names"},"new_user_grace_days":{"type":"integer","title":"New User Grace Days","default":7},"agent_lookback_minutes":{"type":"integer","title":"Agent Lookback Minutes","default":180},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"RulesSection"},"SampleCreateBody":{"properties":{"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"SampleCreateBody"},"SaveContextRequest":{"properties":{"product_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Description"},"answers":{"additionalProperties":true,"type":"object","title":"Answers"}},"type":"object","title":"SaveContextRequest"},"SaveFiltersRequest":{"properties":{"property_filters":{"items":{"$ref":"#/components/schemas/app__routes__posthog__PropertyFilter"},"type":"array","title":"Property Filters"},"activity":{"anyOf":[{"$ref":"#/components/schemas/ActivityFilter"},{"type":"null"}]},"activity_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Activity Days"}},"type":"object","required":["property_filters"],"title":"SaveFiltersRequest"},"SavedFiltersResponse":{"properties":{"filters":{"items":{"$ref":"#/components/schemas/app__routes__posthog__PropertyFilter"},"type":"array","title":"Filters"},"activity":{"anyOf":[{"$ref":"#/components/schemas/ActivityFilter"},{"type":"null"}]},"activity_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Activity Days"}},"type":"object","required":["filters"],"title":"SavedFiltersResponse"},"SavedViewsUpdate":{"properties":{"saved_views":{"additionalProperties":true,"type":"object","title":"Saved Views"}},"type":"object","required":["saved_views"],"title":"SavedViewsUpdate"},"ScoringConfigUpdate":{"properties":{"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["config"],"title":"ScoringConfigUpdate"},"SelectionGateUpdate":{"properties":{"mode":{"type":"string","title":"Mode"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","required":["mode"],"title":"SelectionGateUpdate"},"SendRequest":{"properties":{"override_hold":{"type":"boolean","title":"Override Hold","default":false}},"type":"object","title":"SendRequest","description":"Send, with the option of overruling the judge.\n\nThe judge gates agent sends because nobody is looking at those. A one-off is\nwritten and read by a person, and when that person has read the copy and\nstill wants it sent, they are the higher authority — the alternative is copy\nthat can never be sent by anyone, which is what this flag exists to end.\n\nIt skips the LLM verdict only. Suppression, the per-recipient frequency cap\nand the mechanical unsendable guard (refusal text, unrendered ``{{tokens}}``)\nare not overridable here, and the override is recorded on the draft."},"SignupRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"password":{"type":"string","maxLength":128,"minLength":8,"title":"Password"},"workspace_name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Workspace Name"},"invite_code":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Invite Code"}},"type":"object","required":["email","name","password"],"title":"SignupRequest"},"SlackApprovalChannelRequest":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"channel_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Name"}},"type":"object","required":["channel_id"],"title":"SlackApprovalChannelRequest"},"SubscriptionOption":{"properties":{"value":{"type":"string","title":"Value"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["value","count"],"title":"SubscriptionOption"},"SubscriptionOptionsResponse":{"properties":{"statuses":{"items":{"$ref":"#/components/schemas/SubscriptionOption"},"type":"array","title":"Statuses"},"plans":{"items":{"$ref":"#/components/schemas/SubscriptionOption"},"type":"array","title":"Plans"},"total":{"type":"integer","title":"Total","default":0}},"type":"object","title":"SubscriptionOptionsResponse","description":"Distinct filterable values from the workspace's subscription_events, so the\nbilling-trigger builder offers real values instead of hardcoded guesses."},"SuggestEventFilterGroup":{"properties":{"mode":{"type":"string","title":"Mode"},"events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Events"}},"type":"object","required":["mode","events"],"title":"SuggestEventFilterGroup"},"SuggestEventFilterRequest":{"properties":{"prompt":{"type":"string","maxLength":1000,"minLength":1,"title":"Prompt"}},"type":"object","required":["prompt"],"title":"SuggestEventFilterRequest"},"SuggestTriggerRequest":{"properties":{"prompt":{"type":"string","maxLength":1000,"minLength":1,"title":"Prompt"}},"type":"object","required":["prompt"],"title":"SuggestTriggerRequest"},"SuggestTriggerResponse":{"properties":{"event_name":{"type":"string","title":"Event Name"},"trigger_label":{"type":"string","title":"Trigger Label"},"property_filters":{"items":{"$ref":"#/components/schemas/app__schemas__agent__PropertyFilter"},"type":"array","title":"Property Filters"},"hogql_query":{"type":"string","title":"Hogql Query"},"dropped_filters":{"items":{"$ref":"#/components/schemas/app__schemas__agent__PropertyFilter"},"type":"array","title":"Dropped Filters"},"trigger_clauses":{"items":{"$ref":"#/components/schemas/TriggerClause"},"type":"array","title":"Trigger Clauses"},"trigger_match":{"type":"string","enum":["any","all"],"title":"Trigger Match","default":"any"},"condition_window_days":{"type":"integer","title":"Condition Window Days","default":30}},"type":"object","required":["event_name","trigger_label","property_filters","hogql_query"],"title":"SuggestTriggerResponse"},"SuggestViewResponse":{"properties":{"label":{"type":"string","title":"Label"},"health":{"items":{"type":"string"},"type":"array","title":"Health"},"plan":{"items":{"type":"string"},"type":"array","title":"Plan"},"min_actions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Actions"},"quiet_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Quiet Days"},"event_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Event Days"},"event_groups":{"items":{"$ref":"#/components/schemas/SuggestEventFilterGroup"},"type":"array","title":"Event Groups"},"min_churn_risk":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Churn Risk"},"max_churn_risk":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Churn Risk"},"min_mrr":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Mrr"},"max_mrr":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Mrr"},"revenuecat_status":{"items":{"type":"string"},"type":"array","title":"Revenuecat Status","default":[]},"lifecycle_stage":{"items":{"type":"string"},"type":"array","title":"Lifecycle Stage","default":[]},"signup_within_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Signup Within Days"}},"type":"object","required":["label","health","plan","event_groups"],"title":"SuggestViewResponse"},"SwitchWorkspaceRequest":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"}},"type":"object","required":["workspace_id"],"title":"SwitchWorkspaceRequest"},"TablePrefsUpdate":{"properties":{"prefs":{"additionalProperties":true,"type":"object","title":"Prefs"}},"type":"object","required":["prefs"],"title":"TablePrefsUpdate"},"TextDocumentIn":{"properties":{"title":{"type":"string","maxLength":300,"minLength":1,"title":"Title"},"text":{"type":"string","minLength":1,"title":"Text"}},"type":"object","required":["title","text"],"title":"TextDocumentIn"},"TopUser":{"properties":{"customer_id":{"type":"string","format":"uuid","title":"Customer Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"health":{"type":"string","title":"Health"},"actions_30d":{"type":"integer","title":"Actions 30D"},"mrr_cents":{"type":"integer","title":"Mrr Cents"},"engagement_score":{"type":"number","title":"Engagement Score"}},"type":"object","required":["customer_id","name","email","health","actions_30d","mrr_cents","engagement_score"],"title":"TopUser"},"TriggerClause":{"properties":{"event":{"type":"string","minLength":1,"title":"Event"},"property_filters":{"items":{"$ref":"#/components/schemas/app__schemas__agent__PropertyFilter"},"type":"array","title":"Property Filters"},"presence":{"type":"string","enum":["did","not_did"],"title":"Presence","default":"did"},"not_delay_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":0.0},{"type":"null"}],"title":"Not Delay Days"}},"type":"object","required":["event"],"title":"TriggerClause","description":"One event predicate in a compound trigger.\n\npresence=\"did\": the customer did this event (with these property filters).\npresence=\"not_did\": the customer has NOT done it within not_delay_days after\nthe positive part became true (the wait that makes \"X but not Y\" useful)."},"UpdateEventWeightRequest":{"properties":{"event_name":{"type":"string","title":"Event Name"},"weight":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Weight"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},"type":"object","required":["event_name","weight"],"title":"UpdateEventWeightRequest"},"UrlDocumentIn":{"properties":{"url":{"type":"string","maxLength":2000,"minLength":1,"title":"Url"},"title":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Title"}},"type":"object","required":["url"],"title":"UrlDocumentIn"},"UserResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","name","created_at"],"title":"UserResponse"},"UserUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"}},"type":"object","title":"UserUpdate"},"UsersByEventRequest":{"properties":{"event_names":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Event Names"},"days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Days","default":30}},"type":"object","required":["event_names"],"title":"UsersByEventRequest"},"UsersByEventResponse":{"properties":{"emails":{"items":{"type":"string"},"type":"array","title":"Emails"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["emails","count"],"title":"UsersByEventResponse"},"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"},"ValueCount":{"properties":{"value":{"type":"string","title":"Value"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["value","count"],"title":"ValueCount"},"VariantCreate":{"properties":{"key":{"type":"string","maxLength":4,"minLength":1,"title":"Key"},"name":{"type":"string","maxLength":160,"minLength":1,"title":"Name"},"is_control":{"type":"boolean","title":"Is Control","default":false},"weight":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Weight"},"patch":{"additionalProperties":true,"type":"object","title":"Patch"},"holdout":{"type":"boolean","title":"Holdout","default":false}},"type":"object","required":["key","name","weight"],"title":"VariantCreate"},"VariantSummary":{"properties":{"id":{"type":"string","title":"Id"},"key":{"type":"string","title":"Key"},"name":{"type":"string","title":"Name"},"is_control":{"type":"boolean","title":"Is Control"},"weight":{"type":"integer","title":"Weight"},"patch":{"additionalProperties":true,"type":"object","title":"Patch"},"holdout":{"type":"boolean","title":"Holdout","default":false},"assigned":{"type":"integer","title":"Assigned"},"suppressed":{"type":"integer","title":"Suppressed"},"sent":{"type":"integer","title":"Sent"},"matured":{"type":"integer","title":"Matured"},"returned":{"type":"integer","title":"Returned"},"return_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Return Rate"},"delta_vs_control":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Delta Vs Control"},"p_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P Value"},"significant":{"type":"boolean","title":"Significant"},"opens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Opens"},"open_denominator":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Open Denominator"}},"type":"object","required":["id","key","name","is_control","weight","patch","assigned","suppressed","sent","matured","returned","return_rate","delta_vs_control","p_value","significant","opens","open_denominator"],"title":"VariantSummary"},"ViewResolveRequest":{"properties":{"filter":{"additionalProperties":true,"type":"object","title":"Filter"},"exclude_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Exclude Ids"},"include_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Include Ids"},"preview_limit":{"type":"integer","maximum":200.0,"minimum":0.0,"title":"Preview Limit","default":0}},"type":"object","title":"ViewResolveRequest","description":"A saved view's filter, plus the manual overrides the client tracks alongside it."},"WidgetCreate":{"properties":{"prompt":{"type":"string","maxLength":2000,"minLength":1,"title":"Prompt"}},"type":"object","required":["prompt"],"title":"WidgetCreate"},"WidgetResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"cohort_id":{"type":"string","format":"uuid","title":"Cohort Id"},"prompt":{"type":"string","title":"Prompt"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"viz_type":{"type":"string","title":"Viz Type"},"query_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Query Config"},"result_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result Data"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"status":{"type":"string","title":"Status","default":"pending"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"last_refreshed":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refreshed"},"display_order":{"type":"integer","title":"Display Order","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","workspace_id","cohort_id","prompt","viz_type","created_at"],"title":"WidgetResponse"},"WidgetUpdate":{"properties":{"prompt":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Prompt"},"title":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Title"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"}},"type":"object","title":"WidgetUpdate"},"WorkspaceCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"timezone":{"type":"string","title":"Timezone","default":"UTC"}},"type":"object","required":["name"],"title":"WorkspaceCreate"},"WorkspaceInventory":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"events":{"$ref":"#/components/schemas/EventsSection"},"person_properties":{"$ref":"#/components/schemas/PersonPropertiesSection"},"billing":{"$ref":"#/components/schemas/BillingSection"},"enrichment":{"$ref":"#/components/schemas/EnrichmentSection"},"customers":{"$ref":"#/components/schemas/CustomersSection"},"channels":{"$ref":"#/components/schemas/ChannelsSection"},"existing_agents":{"items":{"$ref":"#/components/schemas/ExistingAgentSummary"},"type":"array","title":"Existing Agents"},"rules":{"$ref":"#/components/schemas/RulesSection"},"freshness":{"$ref":"#/components/schemas/FreshnessSection"}},"type":"object","required":["workspace_id","generated_at","events","person_properties","billing","enrichment","customers","channels","existing_agents","rules","freshness"],"title":"WorkspaceInventory"},"WorkspaceMembershipResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"workspace_name":{"type":"string","title":"Workspace Name"},"role":{"type":"string","title":"Role"}},"type":"object","required":["workspace_id","workspace_name","role"],"title":"WorkspaceMembershipResponse"},"WorkspaceResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"plan_tier":{"type":"string","title":"Plan Tier"},"timezone":{"type":"string","title":"Timezone"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","plan_tier","timezone","created_at"],"title":"WorkspaceResponse"},"WorkspaceUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"}},"type":"object","title":"WorkspaceUpdate"},"app__routes__autosend__BroadcastRequest":{"properties":{"subject":{"type":"string","title":"Subject"},"body_html":{"type":"string","title":"Body Html"},"body_plain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Plain"},"reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reply To"},"unsubscribe_group_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unsubscribe Group Id"}},"type":"object","required":["subject","body_html"],"title":"BroadcastRequest"},"app__routes__posthog__PropertyFilter":{"properties":{"key":{"type":"string","title":"Key"},"value":{"type":"string","title":"Value"},"operator":{"type":"string","title":"Operator","default":"equals"}},"type":"object","required":["key","value"],"title":"PropertyFilter"},"app__routes__resend__BroadcastRequest":{"properties":{"subject":{"type":"string","title":"Subject"},"body_html":{"type":"string","title":"Body Html"},"reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reply To"},"scheduled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled At"}},"type":"object","required":["subject","body_html"],"title":"BroadcastRequest"},"app__schemas__agent__PropertyFilter":{"properties":{"key":{"type":"string","title":"Key"},"operator":{"type":"string","title":"Operator"},"value":{"type":"string","title":"Value"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},"type":"object","required":["key","operator","value"],"title":"PropertyFilter"}}}}