{"openapi":"3.1.0","info":{"title":"NanoCorp API","version":"0.1.0"},"paths":{"/admin/companies/health":{"get":{"tags":["admin"],"summary":"Get Companies Health","description":"Get health status of all non-archived companies and their resources.","operationId":"get_companies_health_admin_companies_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Companies Health Admin Companies Health Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/companies/{company_id}/heal":{"post":{"tags":["admin"],"summary":"Heal Company","description":"Diagnose and re-provision failed/missing resources for a company.","operationId":"heal_company_admin_companies__company_id__heal_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Heal Company Admin Companies  Company Id  Heal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/backfill-email-content":{"post":{"tags":["admin"],"summary":"Backfill Email Content","description":"Backfill body for inbound emails saved with NULL content.\n\nRe-fetches content for inbound emails stored without a body and fills\nthem in place. Buckets: ``updated`` = body recovered; ``empty`` = the\nprovider returned no body either (attachment-only mail; recurs on the\nnext run); ``skipped`` = the row was filled concurrently — not a\nfailure.","operationId":"backfill_email_content_admin_backfill_email_content_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Backfill Email Content Admin Backfill Email Content Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/runs/{run_id}/trace/list":{"get":{"tags":["admin"],"summary":"List Run Trace Files","description":"List all trace files for a run on the Modal volume.","operationId":"list_run_trace_files_admin_runs__run_id__trace_list_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Run Trace Files Admin Runs  Run Id  Trace List Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/runs/{run_id}/trace":{"get":{"tags":["admin"],"summary":"Get Run Trace","description":"Return raw JSONL trace content for a run from the Modal volume.\n\nTries `runs/{run_id}/trace.jsonl` first, then falls back to the first\n.jsonl file found in the run directory.","operationId":"get_run_trace_admin_runs__run_id__trace_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/companies/{company_id}/tasks":{"get":{"tags":["admin"],"summary":"Admin List Tasks","description":"List tasks for any company.","operationId":"admin_list_tasks_admin_companies__company_id__tasks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin"],"summary":"Admin Create Task","description":"Create a task on any company.","operationId":"admin_create_task_admin_companies__company_id__tasks_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tasks/{task_id}":{"get":{"tags":["admin"],"summary":"Admin Get Task","description":"Get a single task by ID.","operationId":"admin_get_task_admin_tasks__task_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin"],"summary":"Admin Update Task","description":"Update a task. Status changes go through the lifecycle (skip_credit=True).","operationId":"admin_update_task_admin_tasks__task_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin"],"summary":"Admin Delete Task","description":"Delete a task (only pending/failed/dispatched).","operationId":"admin_delete_task_admin_tasks__task_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tasks/{task_id}/run":{"post":{"tags":["admin"],"summary":"Admin Trigger Task Run","description":"Trigger execution of a task. Skips credit checks.","operationId":"admin_trigger_task_run_admin_tasks__task_id__run_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/user-auth/{company_id}/disable":{"post":{"tags":["admin"],"summary":"Admin Disable User Auth","description":"Abuse kill switch (D-13/D-32): stamps ``revoked_at`` on the company's\nOIDC client. Structurally irreversible from every provisioning path —\nrestore and enable_user_auth both refuse; only the operator un-revoke\nlever below clears it. ``revoked_reason`` + ``revoked_conglomerate_id``\nsurvive the company row (D-55) so repeat offenders stay visible.","operationId":"admin_disable_user_auth_admin_user_auth__company_id__disable_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"reason","in":"query","required":true,"schema":{"type":"string","minLength":4,"maxLength":500,"title":"Reason"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Disable User Auth Admin User Auth  Company Id  Disable Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["health"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/health/stripe":{"get":{"tags":["health"],"summary":"Health Stripe","description":"Guard 6 (SPEC_STRIPE_MOR_ACCOUNT_SPLIT §9.4): the distinct-account-id + API-version probe.\n\nRun BY HAND in the §11 dev rehearsal (``curl -H 'Authorization: Bearer $ADMIN_API_KEY'``):\nafter the dev swap, hit this against dev and only proceed to prod on a 200. It is NOT\nan automated deploy gate — Modal deploys are non-atomic, so a post-deploy check can\nonly detect, not block (the string-checkable guards 1-4 crash-on-boot in prod). Admin-\ngated so it isn't an open Stripe-API DoS/cost vector, and it makes a live network call\nso it stays OFF the request hot path + out of the startup validator.\n\nChecks (with each account's LIVE key):\n  - each account's own ``acct_…`` id → assert they DIFFER (the only guard that proves\n    two *distinct* accounts; guards 1-4 only compare strings). ``resolve_own_account_id``\n    recovers the id from Stripe's error if the key lacks account/KYC read scope, so the\n    MoR key needs no ``accounts``/KYC permission.\n  - The MoR account's webhook endpoints are pinned to ``STRIPE_API_VERSION``.","operationId":"health_stripe_health_stripe_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/beacon/snippet.js":{"get":{"tags":["beacon"],"summary":"Beacon Snippet","description":"Legacy-compat loader: handle -> uuid -> same body as /analytics/v1.js.","operationId":"beacon_snippet_beacon_snippet_js_get","parameters":[{"name":"s","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"description":"Company handle","title":"S"},"description":"Company handle"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"get":{"tags":["auth"],"summary":"Login","description":"Redirect user to WorkOS AuthKit for authentication.","operationId":"login_auth_login_get","parameters":[{"name":"redirect_url","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Url"}},{"name":"ref","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref"}},{"name":"screen_hint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Screen Hint"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/callback":{"get":{"tags":["auth"],"summary":"Callback","description":"Handle OAuth callback from WorkOS.","operationId":"callback_auth_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/logout":{"get":{"tags":["auth"],"summary":"Logout","description":"End the WorkOS session and redirect to frontend login.\n\nOIDC provider spec D-53: dashboard sign-out also revokes EVERY SSO session\nrecord for this user (keyed on user_id — a NULL workos_session_id must not\nmake records unfindable) and back-channel-terminates the upstream WorkOS\nsessions those records held. Revoking our record alone is not sufficient:\n/oidc/authorize treats a revoked record as \"no session\" and bounces to\nWorkOS, whose live session would near-silently re-login the previous user.\n\nThe get_logout_url redirect hop is deliberately KEPT alongside the\nback-channel kill until the Phase-1 human verification confirms\nrevoke_session alone stops AuthKit silent re-auth (§14); only then may the\nhop be dropped. The SSO cookie is cleared on every response as belt over\nthe record revoke (it was never authoritative, but clearing keeps this\nbrowser signed out even if the DB revoke failed).","operationId":"logout_auth_logout_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["auth"],"summary":"Me","description":"Principal-aware identity (Spec 2, D-17).\n\nAnswers for both user credentials (web JWT, ``nano_u_v1_`` session/PAT — the\nfrontend only ever sees this variant) and company credentials\n(``nano_c_v1_``). ``whoami`` calls this.","operationId":"me_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}}},"security":[{"HTTPBearer":[]}]},"delete":{"tags":["auth"],"summary":"Delete Account","description":"Delete the current user's account.\n\nCompanies are archived, the conglomerate is hard-deleted, and the user row\nis soft-deleted (deleted_at set). The soft-delete preserves the normalized\nemail so the signup collision check at /auth/callback continues to block\nre-signup with the same mailbox, closing the referral-credit farming loop.","operationId":"delete_account_auth_me_delete","responses":{"204":{"description":"Successful Response"}},"security":[{"HTTPBearer":[]}]}},"/auth/cli/start":{"get":{"tags":["auth"],"summary":"Cli Start","description":"Build the WorkOS authorization URL for the loopback login flow.\n\nThe returned URL redirects (after WorkOS login) to ``/auth/cli/callback`` with\na signed ``state`` carrying the loopback port + PKCE challenge. ``screen_hint``\nonly picks which AuthKit tab opens first (``nanocorp signup`` sends\n``sign-up``); the find-or-create callback is identical for both verbs.","operationId":"cli_start_auth_cli_start_get","parameters":[{"name":"port","in":"query","required":true,"schema":{"type":"integer","description":"Loopback port the one-time code will be 302'd to","title":"Port"},"description":"Loopback port the one-time code will be 302'd to"},{"name":"code_challenge","in":"query","required":true,"schema":{"type":"string","description":"PKCE S256 challenge (base64url, no padding)","title":"Code Challenge"},"description":"PKCE S256 challenge (base64url, no padding)"},{"name":"env","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Env"}},{"name":"screen_hint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"AuthKit tab to default to: 'sign-up' (signup) or 'sign-in' (login). Junk is ignored.","title":"Screen Hint"},"description":"AuthKit tab to default to: 'sign-up' (signup) or 'sign-in' (login). Junk is ignored."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CliStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/cli/callback":{"get":{"tags":["auth"],"summary":"Cli Callback","description":"WorkOS redirect target for the loopback flow.\n\nVerifies the signed ``state`` (the loopback port is trusted only because it is\nsigned — never an attacker-chosen port). On success, mints a single-use\none-time code bound to the PKCE challenge and 302s it to the loopback. ANY\nfailure — a WorkOS error redirect (``?error=`` with no ``code``), the code\nexchange, or minting — instead 302s an ``?error=`` to the loopback so the CLI\nfails fast rather than hanging until its timeout.","operationId":"cli_callback_auth_cli_callback_get","parameters":[{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}},{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"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"}}}}}}},"/auth/cli/token":{"post":{"tags":["auth"],"summary":"Cli Token","description":"Exchange a loopback one-time code (+ PKCE verifier) for a session key.","operationId":"cli_token_auth_cli_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CliTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CliTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/cli/logout":{"post":{"tags":["auth"],"summary":"Cli Logout","description":"Revoke the presented credential server-side (``logout`` default).\n\nRevokes exactly the api_key behind the bearer the CLI sent (its stored\nsession). Idempotent and no-op for a web JWT (no api_key row).","operationId":"cli_logout_auth_cli_logout_post","responses":{"204":{"description":"Successful Response"}},"security":[{"HTTPBearer":[]}]}},"/auth/cli/device/start":{"post":{"tags":["auth"],"summary":"Cli Device Start","description":"Begin the device-code fallback (RFC 8628, WorkOS-proxied).","operationId":"cli_device_start_auth_cli_device_start_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceStartResponse"}}}}}}},"/auth/cli/device/token":{"post":{"tags":["auth"],"summary":"Cli Device Token","description":"Poll a device authorization. Returns a pending status, or — once the user\napproves — the minted session key + identity.","operationId":"cli_device_token_auth_cli_device_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/tokens":{"get":{"tags":["auth"],"summary":"List Tokens","description":"List the caller's live (non-revoked) personal access tokens. Never returns\nsecrets. The interactive login session (``cli_session``) is intentionally\nexcluded — it is managed by ``login`` / ``logout`` / ``whoami``, not here.","operationId":"list_tokens_auth_tokens_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TokenResponse"},"type":"array","title":"Response List Tokens Auth Tokens Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["auth"],"summary":"Create Token","description":"Mint a personal access token (``nano_u_v1_`` PAT). The raw value is returned\nexactly once. User credentials only, holding conglomerate scope (Spec 2 §7).","operationId":"create_token_auth_tokens_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTokenRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/auth/tokens/{token_id}":{"delete":{"tags":["auth"],"summary":"Revoke Token","description":"Soft-revoke one of the caller's own personal access tokens (idempotent).\n\nScoped to the caller's own keys (``subject_id``), mirroring ``list_tokens`` —\nyou cannot revoke another user's PAT even within your conglomerate (matters\nonce a conglomerate has multiple users). Follows the ownership canon: a\ngenuinely-missing token is 404, a token owned by someone else is 403\n(foreign-but-existing), never masked as 404. Only PATs are revocable here; the\nlogin session (``cli_session``) is revoked via ``logout``.","operationId":"revoke_token_auth_tokens__token_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Token Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conglomerates/me/connect-status":{"get":{"tags":["conglomerates"],"summary":"Get My Connect Status","description":"Return Stripe Connect onboarding state for the current conglomerate.","operationId":"get_my_connect_status_conglomerates_me_connect_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectStatusResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/conglomerates/me":{"get":{"tags":["conglomerates"],"summary":"List My Conglomerates","description":"List all conglomerates the current user belongs to.","operationId":"list_my_conglomerates_conglomerates_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConglomerateListResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/conglomerates/{conglomerate_id}/credit-ledger":{"get":{"tags":["conglomerates"],"summary":"Get Credit Ledger","description":"Get credit transaction history with smart grouping.\n\nTOKEN_USAGE_PARTIAL entries are grouped by run_id, summing credits.\nTOOL_USAGE entries are also grouped by run_id when present (e.g. a worker\nthat fired N verify_email calls inside one task collapses to a single row).\nLegacy TOOL_USAGE rows without run_id, and all other event types, are\nreturned as individual rows.","operationId":"get_credit_ledger_conglomerates__conglomerate_id__credit_ledger_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core__schemas__conglomerate__CreditLedgerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conglomerates/{conglomerate_id}":{"get":{"tags":["conglomerates"],"summary":"Get Conglomerate","description":"Get a conglomerate by ID. User must belong to it.","operationId":"get_conglomerate_conglomerates__conglomerate_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConglomerateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["conglomerates"],"summary":"Update Conglomerate","description":"Update a conglomerate's settings (e.g. daily credit cap).","operationId":"update_conglomerate_conglomerates__conglomerate_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConglomerateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConglomerateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/activity":{"get":{"tags":["activity"],"summary":"List Activity","description":"List activity events for a company, newest first.","operationId":"list_activity_companies__company_id__activity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Before"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/analytics/summary":{"get":{"tags":["analytics"],"summary":"Get Analytics Summary Endpoint","description":"Return KPI + trend line for the owner dashboard.\n\n`range` is one of `1d`, `7d`, `30d`, `90d`. Anything else returns 400.","operationId":"get_analytics_summary_endpoint_companies__company_id__analytics_summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"range","in":"query","required":false,"schema":{"type":"string","default":"30d","title":"Range"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/analytics/countries":{"get":{"tags":["analytics"],"summary":"Get Analytics Countries Endpoint","description":"Return visitors + pageviews per country for the owner-dashboard map.\n\n`range` matches `/summary`: one of `1d`, `7d`, `30d`, `90d`.","operationId":"get_analytics_countries_endpoint_companies__company_id__analytics_countries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"range","in":"query","required":false,"schema":{"type":"string","default":"30d","title":"Range"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsCountries"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/v1.js":{"get":{"tags":["analytics"],"summary":"Analytics Loader","description":"Return the per-company analytics loader.","operationId":"analytics_loader_analytics_v1_js_get","parameters":[{"name":"c","in":"query","required":true,"schema":{"type":"string","minLength":8,"maxLength":64,"title":"C"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/e/":{"post":{"tags":["analytics"],"summary":"Capture Single","operationId":"capture_single_analytics_e__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/analytics/batch/":{"post":{"tags":["analytics"],"summary":"Capture Batch","operationId":"capture_batch_analytics_batch__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/conglomerates/{conglomerate_id}/companies":{"post":{"tags":["companies"],"summary":"Create Company","description":"Create a new company in a conglomerate.","operationId":"create_company_conglomerates__conglomerate_id__companies_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCompanyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["companies"],"summary":"List Companies","description":"List all non-archived companies for a conglomerate.","operationId":"list_companies_conglomerates__conglomerate_id__companies_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conglomerates/{conglomerate_id}/companies/archived":{"get":{"tags":["companies"],"summary":"List Archived Companies","description":"The settings \"Archived companies\" list (archive spec §8): name, handle,\narchived date, lifetime earnings, current balance. Money stays reachable —\nthe row's balance pairs with the allowlisted withdrawal routes. No company\npages exist for archived companies and there is no unarchive.","operationId":"list_archived_companies_conglomerates__conglomerate_id__companies_archived_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchivedCompanyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}":{"get":{"tags":["companies"],"summary":"Get Company","description":"Get a company by ID.","operationId":"get_company_companies__company_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["companies"],"summary":"Update Company","description":"Update a company.","operationId":"update_company_companies__company_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCompanyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["companies"],"summary":"Delete Company","description":"Archive a company (irreversible-for-now soft delete; UI says \"Archive\").\n\nIdempotent: repeating on an archived company is a 204 no-op. 502 when a\nlive-mode Stripe deactivation failed — nothing archived, retry. Money stays\nreachable: the withdrawal routes are allowlisted for archived companies.\nSpec: specs/DRAFT_SPEC_COMPANY_ARCHIVE.md.","operationId":"delete_company_companies__company_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ArchiveCompanyRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/resources":{"get":{"tags":["companies"],"summary":"List Company Resources","description":"Combined provisioning status of the company's GitHub repo, Neon database,\nand Vercel project — one cheap round-trip for the `nanocorp init` poll.\n\nA resource whose row does not exist yet is reported as ``not_provisioned``.","operationId":"list_company_resources_companies__company_id__resources_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResourcesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/provision":{"post":{"tags":["companies"],"summary":"Trigger Company Provision","description":"Idempotently (re-)spawn infrastructure provisioning for a company,\nregardless of status — the resume backstop for `nanocorp init` (§5.7).\n\nThe heartbeat heal is active-only, so a paused/import company whose initial\nprovisioning died would never self-heal; init calls this when a resource is\nstill stuck after a poll round. Provisioning short-circuits on already-active\nresources, so repeated calls are safe. ``seed_repo`` forwards to the Modal\nspawn as ``auto_init`` (False = an import resume — do not re-seed a README).","operationId":"trigger_company_provision_companies__company_id__provision_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionCompanyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionTriggerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/api-key":{"get":{"tags":["companies"],"summary":"Get Company Api Key","description":"The company's permanent API key. The first read mints it (D-9/D-14), so\nthere is no 404/empty state. The raw token is returned to the owner:\nit is their own credential and every sandbox env already carries it;\n``Cache-Control: no-store`` keeps it out of shared caches.","operationId":"get_company_api_key_companies__company_id__api_key_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/api-key/rotate":{"post":{"tags":["companies"],"summary":"Rotate Company Api Key","description":"Rotate the company key (D-4): the old key stops working within the 60s\nauth-cache TTL; the new one auto-cascades to the deployed site (env push +\nproduction redeploy) and to the next sandbox launch. Human-only: no agent\nsurface exposes this.","operationId":"rotate_company_api_key_companies__company_id__api_key_rotate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/meta-ads":{"get":{"tags":["companies"],"summary":"Get Company Meta Ads","description":"The Ads-panel DTO (polled). Hidden client-side when ineligible; never mints a Stripe URL.","operationId":"get_company_meta_ads_companies__company_id__meta_ads_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetaAdsPanelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["companies"],"summary":"Set Company Meta Ads Cap","description":"Set the daily cap: 0 = pause; [3, 150] = live, funded from the credit balance. Rejects a cap\nthe balance cannot fund right now (exact-numbers error). A positive cap while\nINSUFFICIENT_CREDITS just re-spawns the reconciler (resume is automatic). The route only\nvalidates + persists + spawns the reconciler (§4.7).","operationId":"set_company_meta_ads_cap_companies__company_id__meta_ads_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetDailyCapRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetaAdsPanelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/meta-ads/regenerate":{"post":{"tags":["companies"],"summary":"Regenerate Company Meta Ad","description":"Regenerate the creative (rate-limited to 2/day). Hot-swaps if the ad is live (§5.2).","operationId":"regenerate_company_meta_ad_companies__company_id__meta_ads_regenerate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetaAdsPanelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/meta-ads/preview":{"get":{"tags":["companies"],"summary":"Get Company Meta Ad Preview","description":"Real, pixel-accurate Meta ad preview for one placement, rendered by the popover.\n\nProxied server-side so the Meta access token (which Meta embeds in the preview URL)\nnever reaches the browser (§8). Returns the embeddable HTML for an ``<iframe srcdoc>``.\n404 when there is no creative yet or Meta can't render it — the frontend then falls\nback to a local mock. Best-effort: never part of billing/lifecycle.","operationId":"get_company_meta_ad_preview_companies__company_id__meta_ads_preview_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"placement","in":"query","required":false,"schema":{"type":"string","default":"MOBILE_FEED_STANDARD","title":"Placement"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetaAdPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/dashboard":{"get":{"tags":["dashboard"],"summary":"Get Dashboard","description":"Fetch all dashboard data in a single request.","operationId":"get_dashboard_companies__company_id__dashboard_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/milestones":{"get":{"tags":["milestones"],"summary":"List Milestones","description":"Trophy shelf (achieved), the unseen-marquee modal queue, and the next-goal teaser.","operationId":"list_milestones_companies__company_id__milestones_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MilestonesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/milestones/seen":{"post":{"tags":["milestones"],"summary":"Mark Milestones Seen","description":"Mark all currently-unseen milestones seen (per-company).\n\nCalled by the frontend AFTER the celebration moment has actually played, so a\nfailed load never silently consumes the celebration. Only one milestone kind\nexists (`first_dollar`, unique per company), so marking all == marking the one\nthat played; revisit scoping if/when more milestone kinds ship.","operationId":"mark_milestones_seen_companies__company_id__milestones_seen_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkMilestonesSeenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/documents":{"get":{"tags":["documents"],"summary":"List Documents","description":"List all visible documents for a company.","operationId":"list_documents_companies__company_id__documents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/documents/{document_type}":{"get":{"tags":["documents"],"summary":"Get Document","description":"Get a single document by type.","operationId":"get_document_companies__company_id__documents__document_type__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"document_type","in":"path","required":true,"schema":{"type":"string","title":"Document Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["documents"],"summary":"Upsert Document","description":"Create or update a document.","operationId":"upsert_document_companies__company_id__documents__document_type__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"document_type","in":"path","required":true,"schema":{"type":"string","title":"Document Type"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertDocumentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["documents"],"summary":"Delete Document","description":"Delete a document.","operationId":"delete_document_companies__company_id__documents__document_type__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"document_type","in":"path","required":true,"schema":{"type":"string","title":"Document Type"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/domains/search":{"get":{"tags":["domains"],"summary":"Search Domains","description":"Search buyable domains: bare name → suggestion grid, full domain → exact check.","operationId":"search_domains_companies__company_id__domains_search_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":253,"default":"","title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DomainSearchResultResponse"},"title":"Response Search Domains Companies  Company Id  Domains Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/domains/checkout-session":{"post":{"tags":["domains"],"summary":"Create Domain Checkout Session","description":"Re-verify availability/price and mint the Stripe Checkout session.","operationId":"create_domain_checkout_session_companies__company_id__domains_checkout_session_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainCheckoutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/domains":{"get":{"tags":["domains"],"summary":"List Domains","description":"The company-visible slice of the conglomerate's domain pool: attached\nhere, parked, or bought from this company (the settings UI polls this\nthrough order_pending → registered after returning from Stripe).","operationId":"list_domains_companies__company_id__domains_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/domains/{domain_purchase_id}/attach":{"post":{"tags":["domains"],"summary":"Attach Domain","description":"Attach a registered pool domain to this company (replaces its current domain).","operationId":"attach_domain_companies__company_id__domains__domain_purchase_id__attach_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"domain_purchase_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Domain Purchase Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainPurchaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/domains/{domain_purchase_id}/detach":{"post":{"tags":["domains"],"summary":"Detach Domain","description":"Detach the domain from this company; it stays in the pool as Parked.","operationId":"detach_domain_companies__company_id__domains__domain_purchase_id__detach_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"domain_purchase_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Domain Purchase Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainPurchaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/files":{"post":{"tags":["files"],"summary":"Upload File","description":"Upload one file (multipart: ``file``, optional ``path`` and ``source``).\n\nThe multipart body is parsed MANUALLY inside the handler instead of\ndeclaring ``UploadFile = File(...)`` parameters. FastAPI parses a declared\nmultipart body BEFORE dependencies run; with manual parsing, ownership auth\n(``get_verified_company``) and the rate limit run first, and Content-Length\nis pre-checked before a single body byte is read. Starlette's multipart\nparser spools parts over 1MB to a temp file, so large uploads never sit in\nRAM. Trade-off: the OpenAPI requestBody for this route is intentionally\nundocumented; the frontend uploads with a raw ``fetch`` + ``FormData``.","operationId":"upload_file_companies__company_id__files_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyFileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["files"],"summary":"List Files","description":"Flat file list ordered by path, plus usage totals and quota constants.","operationId":"list_files_companies__company_id__files_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["files"],"summary":"Delete Files By Prefix","description":"Delete every file under a folder prefix: rows first, then blobs.\n\n``validate_prefix`` normalizes to exactly one trailing \"/\" so the match can\nonly take whole segments (\"brand/\" never matches \"brandbook.pdf\").","operationId":"delete_files_by_prefix_companies__company_id__files_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"prefix","in":"query","required":true,"schema":{"type":"string","title":"Prefix"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrefixDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/files/{file_id}":{"delete":{"tags":["files"],"summary":"Delete File","description":"Delete one file: row first, then best-effort blob delete.","operationId":"delete_file_companies__company_id__files__file_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/files/{file_id}/download":{"get":{"tags":["files"],"summary":"Download File","description":"302 to a short-TTL presigned GET; the bytes never touch the API.\n\nThe presigned URL is a bearer download capability: NEVER log it. The\nadapter logs the object key and expiry instead.","operationId":"download_file_companies__company_id__files__file_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"302":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/founding":{"post":{"tags":["founding"],"summary":"Start Founding","description":"Capture the idea and open an interview in ``naming``.\n\nFail-fast gates only (Light tier, founding caps, the platform company cap).\n**No moderation call**: moderation moved in-interview to the model's\n``reject_founding`` tool, which also covers the mid-interview pivot an\nidea-only gate never saw. **No credit gate either**: interviewing is free and\na founder can top up mid-flight; the credit floor applies to the INITIAL turn\nat the very end, where it is a visible stall rather than a refusal.","operationId":"start_founding_founding_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartFoundingRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/founding/current":{"get":{"tags":["founding"],"summary":"Get Current Founding","description":"The whole page state: the open row, its transcript, and claim liveness.\n\n``segment_running`` is what the frontend watchdog polls before firing a\nsilent re-kick — a stale claim after ~15s of stream silence means the segment\ndied (deploy, scale-down) and nobody is coming back to it.\n\nFalls back to the most recent terminal row when nothing is open, so a\n``founded`` page can still redirect and a ``rejected`` one still renders its\ncard after a refresh.","operationId":"get_current_founding_founding_current_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundingCurrentResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/companies/{company_id}/v3-upgrade":{"post":{"tags":["founding"],"summary":"Start V3 Upgrade","description":"Open a switch interview for an existing v2 company (spec 2026-08-26).","operationId":"start_v3_upgrade_companies__company_id__v3_upgrade_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"X-Posthog-Session-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Posthog-Session-Id"}},{"name":"X-Client-Mobile","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Client-Mobile"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["founding"],"summary":"Get V3 Upgrade Status","description":"Sheet + upgrade-page loader: interview state, standing, eligibility.","operationId":"get_v3_upgrade_status_companies__company_id__v3_upgrade_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V3UpgradeStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/founding/handle-check":{"get":{"tags":["founding"],"summary":"Check Handle","description":"Live availability for the name picker: companies UNION open foundings.\n\nExcludes the caller's own open interview, so re-checking the handle you\nalready reserved reads ``available`` rather than ``reserved``.","operationId":"check_handle_founding_handle_check_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"h","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":32,"title":"H"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandleCheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/founding/{founding_id}/generate-name":{"post":{"tags":["founding"],"summary":"Generate Founding Name","description":"Suggest an available adjective+noun name + handle from the lexicon.\n\nDoes not lock either — CONTINUE still posts ``/name``. The picker\nthreads ``exclude_founding_id`` so a regenerate can keep offering a\nhandle this interview already reserved.","operationId":"generate_founding_name_founding__founding_id__generate_name_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"founding_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Founding Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateNameResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/founding/{founding_id}/name":{"post":{"tags":["founding"],"summary":"Name Founding","description":"Lock the name + handle, hard-reserve it, and start interviewing.\n\nThis flip is the founding caps' **counting point** (it stamps\n``interview_started_at``), so the caps are re-checked here even though\n``POST /founding`` already checked them: the cheap check up front saves a\nfounder a wasted name, and this one is the authoritative one.","operationId":"name_founding_founding__founding_id__name_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"founding_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Founding Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NameFoundingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/founding/{founding_id}/turn":{"post":{"tags":["founding"],"summary":"Post Founding Turn","description":"Answer the pending question (or kick) and stream the resulting segment.\n\nAn **empty body is the idempotent kick**: it starts the first segment after\nnaming, retries a segment that died (deploy, crash), and retries a failed\nfounding. That single entry point is why the Retry button, the frontend\nwatchdog and the heartbeat backstop are all the same code path.\n\nThe segment runs as a task that a client disconnect cannot cancel; this\nresponse is only a view of it.\n\n**The claim is taken before anything else happens**, for two reasons that\nare easy to get backwards. It has to precede the STATUS CODE, because a 409\ndelivered as an error event inside a 200 is not a 409: the client's\nre-attach branch never fires and the connection sits open. And it has to\nprecede the APPEND, because appending outside the claim writes at the seq a\nrunning segment is about to use — the loser leaves the transcript ending\n``assistant(tool_use) -> user(text)`` with no tool_result, which is not a\nvalid conversation and 400s on every replay from then on. That one is not\nrecoverable except by starting over.","operationId":"post_founding_turn_founding__founding_id__turn_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"founding_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Founding Id"}},{"name":"X-Posthog-Session-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Posthog-Session-Id"}},{"name":"X-Client-Mobile","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Client-Mobile"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AnswerFoundingRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/founding/{founding_id}/found":{"post":{"tags":["founding"],"summary":"Found Founding","description":"The founder's approval: start founding from ``reviewing`` (spec §4.3, D5).\n\nSame SSE response shape as ``/turn`` — the founder watches checklist frames\non this stream, ``done`` last, always. Same claim discipline too: the claim\nis taken before the status code is chosen, so a concurrent segment gets a\nreal 409 the client re-attaches on.\n\nCaps were counted at naming; the finalizer's stall-don't-fail gate check\n(step 3) is unchanged and still protects credits/plan/pause at the\nhandoff. Standing to found (spec CREDIT_NOTICES D13): (a Founder plan OR\na live trial) AND at least 12 credits — checked here, before the claim,\nas a typed 402 whose payload is the flip card the review screen renders\nin FOUND's place.\n\nThe v3 welcome grant (spec V3_GA_FLIP D2) fires FIRST, unconditionally,\nonce per conglomerate ever: a first-time presser banks 15 credits before\nthe gate reads the balance, so a fresh trial account founds without a\ntop-up. The conglomerate is re-loaded after it so the gate sees the fresh\nbalance.","operationId":"found_founding_founding__founding_id__found_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"founding_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Founding Id"}},{"name":"X-Posthog-Session-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Posthog-Session-Id"}},{"name":"X-Client-Mobile","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Client-Mobile"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/founding/{founding_id}/stream":{"get":{"tags":["founding"],"summary":"Stream Founding","description":"Re-attach after a refresh: tail the persisted transcript by ``seq``.\n\nHonest limitation (spec): live token deltas exist only on the original POST\nconnection. A re-attached client catches up at persisted-message\ngranularity until the next yield, which is fine because yields are where the\nfounder is actually needed.","operationId":"stream_founding_founding__founding_id__stream_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"founding_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Founding Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/founding/{founding_id}/abandon":{"post":{"tags":["founding"],"summary":"Abandon Founding","description":"Start over: flip to ``abandoned``, which frees the handle reserve.\n\nOnly from an OPEN status — a founded company is not something a page button\nshould be able to walk back, and abandoning a ``rejected`` row would lose the\ndistinction the two statuses exist to keep.","operationId":"abandon_founding_founding__founding_id__abandon_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"founding_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Founding Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/founding/{founding_id}/interrupt":{"post":{"tags":["founding"],"summary":"Interrupt Founding","description":"The founder's ✕ STOP (reconciliation-2 spec §6), mirroring the sessions\ninterrupt: stamp ``interrupt_requested_at`` and let the segment loop wrap up\nat its next boundary — between tool calls, so the transcript stays paired.\n\nTwo 409s, both \"nothing to stop\": no live claim per the same liveness\npredicate ``segment_running`` uses, and a conditional UPDATE that matched\nzero rows because the segment finished between that read and the write.\nThe stamp is idempotent — a second press returns the first's timestamp —\nand the founder's own next turn clears it.","operationId":"interrupt_founding_founding__founding_id__interrupt_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"founding_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Founding Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InterruptFoundingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/runway-projection":{"get":{"tags":["engine"],"summary":"Get Runway Projection","description":"Runway/burn inputs for the Engine panel. Per-mode math runs on the client.","operationId":"get_runway_projection_companies__company_id__runway_projection_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunwayProjectionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/tasks":{"post":{"tags":["tasks"],"summary":"Create Task","description":"Create a new task for a company.","operationId":"create_task_companies__company_id__tasks_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["tasks"],"summary":"List Tasks","description":"List tasks for a company, with optional status filter.","operationId":"list_tasks_companies__company_id__tasks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tasks/{task_id}":{"get":{"tags":["tasks"],"summary":"Get Task","description":"Get a single task by ID.","operationId":"get_task_tasks__task_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["tasks"],"summary":"Update Task","description":"Update a task (user-facing fields).","operationId":"update_task_tasks__task_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tasks"],"summary":"Delete Task","description":"Delete a task (only if pending).","operationId":"delete_task_tasks__task_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/chat":{"post":{"tags":["chat"],"summary":"Chat","description":"Stream a CEO agent response via SSE (Vercel AI SDK protocol).","operationId":"chat_companies__company_id__chat_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/chat/messages":{"get":{"tags":["chat"],"summary":"Get Messages","description":"Get message history for a company's chat thread.","operationId":"get_messages_companies__company_id__chat_messages_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/tasks/{task_id}/run":{"post":{"tags":["runs"],"summary":"Trigger Task Run","description":"Trigger execution of a pending task.\n\nArgs:\n    soft_timeout_min: Override the soft timeout (minutes) for testing.\n    wrapup_timeout_min: Override the wrap-up timeout (minutes, can be fractional).\n    final_timeout_min: Override the final timeout (minutes, can be fractional).","operationId":"trigger_task_run_companies__company_id__tasks__task_id__run_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}},{"name":"soft_timeout_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Soft Timeout Min"}},{"name":"wrapup_timeout_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Wrapup Timeout Min"}},{"name":"final_timeout_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Final Timeout Min"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/ceo/trigger":{"post":{"tags":["runs"],"summary":"Trigger Ceo Run","description":"Manually trigger a CEO run (fire-and-forget via Modal).","operationId":"trigger_ceo_run_companies__company_id__ceo_trigger_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Trigger Ceo Run Companies  Company Id  Ceo Trigger Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/runs":{"get":{"tags":["runs"],"summary":"List Runs","description":"List runs for a company.","operationId":"list_runs_companies__company_id__runs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}":{"get":{"tags":["runs"],"summary":"Get Run","description":"Get a single run by ID.","operationId":"get_run_runs__run_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/runs/{run_id}/messages":{"get":{"tags":["runs"],"summary":"Get Run Messages","description":"Get execution log messages for a run (supports polling via 'after' param).","operationId":"get_run_messages_runs__run_id__messages_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only return messages after this timestamp","title":"After"},"description":"Only return messages after this timestamp"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunMessageListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/sessions":{"post":{"tags":["sessions"],"summary":"Create Session","description":"Create a new session and its first turn from a user message.","operationId":"create_session_companies__company_id__sessions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"X-Posthog-Session-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Posthog-Session-Id"}},{"name":"X-Client-Mobile","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Client-Mobile"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionTurnCreatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["sessions"],"summary":"List Sessions","description":"Unified session list (chat + scheduled), sorted by updated_at.","operationId":"list_sessions_companies__company_id__sessions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}":{"get":{"tags":["sessions"],"summary":"Get Session Detail","description":"Session detail with turns and the full event replay (seq order).","operationId":"get_session_detail_sessions__session_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/messages":{"post":{"tags":["sessions"],"summary":"Post Session Message","description":"Start the next turn of an existing session.\n\n409 while a turn is active (the lock-by-insert unique index); 402-class\nSessionGateError with a machine-readable reason on gate failure — nothing\nis persisted in either case (decision 15: no fake \"queued\" state).","operationId":"post_session_message_sessions__session_id__messages_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}},{"name":"X-Posthog-Session-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Posthog-Session-Id"}},{"name":"X-Client-Mobile","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Client-Mobile"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostSessionMessageRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionTurnCreatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/interrupt":{"post":{"tags":["sessions"],"summary":"Interrupt Session","description":"Flag the active turn for the compressed wrap-up (decision 17).\n\nThe sandbox entrypoint's control-signal poll picks the flag up and calls\ninterrupt() with a ~60-90s budget. 409 when no turn is active — including\nthe crashed-turn window, where only the recovery sweep frees the lock\n(accepted for alpha, first-review H1; the UI shows honest copy).","operationId":"interrupt_session_sessions__session_id__interrupt_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}},{"name":"X-Posthog-Session-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Posthog-Session-Id"}},{"name":"X-Client-Mobile","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Client-Mobile"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InterruptSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/stream":{"get":{"tags":["sessions"],"summary":"Stream Session","description":"SSE tail of the session's event stream, by ``seq`` cursor.\n\nLive view and replay are the same endpoint: pass ``?cursor=`` (or the SSE\n``Last-Event-ID`` header on reconnect) to resume. Emits:\n- ``event: message`` frames (``id:`` = the row's seq; data = run message)\n- ``event: turn`` frames whenever a turn's status changes (the composer's\n  end-of-turn signal)\n- ``: ping`` comments to keep intermediaries from buffering.\n\nDeliberately DB-tail polling (~400ms) decoupled from the intake POST:\nrefresh-safe, and how a scheduled turn is watched live. The overlap\nre-read is time-based and generous; the client dedupes by seq.","operationId":"stream_session_sessions__session_id__stream_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/secrets":{"get":{"tags":["secrets"],"summary":"List Company Secrets","operationId":"list_company_secrets_companies__company_id__secrets_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SecretResponse"},"title":"Response List Company Secrets Companies  Company Id  Secrets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["secrets"],"summary":"Create Company Secret","operationId":"create_company_secret_companies__company_id__secrets_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSecretRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/secrets/{key}":{"put":{"tags":["secrets"],"summary":"Update Company Secret","operationId":"update_company_secret_companies__company_id__secrets__key__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSecretRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["secrets"],"summary":"Delete Company Secret","operationId":"delete_company_secret_companies__company_id__secrets__key__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/emails":{"get":{"tags":["emails"],"summary":"List Company Emails","description":"List emails for a company.","operationId":"list_company_emails_companies__company_id__emails_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"unread_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unread Only"}},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/emails/stats":{"get":{"tags":["emails"],"summary":"Get Email Stats","description":"Get email stats (total sent/received) for a company.","operationId":"get_email_stats_companies__company_id__emails_stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/emails/{email_id}":{"get":{"tags":["emails"],"summary":"Get Email Detail","description":"Get email details (marks as read).","operationId":"get_email_detail_emails__email_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Email Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/emails/send":{"post":{"tags":["emails"],"summary":"Send Email","description":"Send an email from a company (user-initiated).","operationId":"send_email_companies__company_id__emails_send_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/github":{"get":{"tags":["github"],"summary":"Get Github Info","description":"Get GitHub repo info for a company.","operationId":"get_github_info_companies__company_id__github_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitHubRepoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/github/provision":{"post":{"tags":["github"],"summary":"Provision Github Repo","description":"Manually trigger GitHub repo provisioning for a company.","operationId":"provision_github_repo_companies__company_id__github_provision_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResourceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/github/collaborators":{"get":{"tags":["github"],"summary":"List Company Github Collaborators","operationId":"list_company_github_collaborators_companies__company_id__github_collaborators_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CollaboratorResponse"},"title":"Response List Company Github Collaborators Companies  Company Id  Github Collaborators Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["github"],"summary":"Add Company Github Collaborator","operationId":"add_company_github_collaborator_companies__company_id__github_collaborators_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCollaboratorRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollaboratorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/github/collaborators/{github_username}":{"delete":{"tags":["github"],"summary":"Remove Company Github Collaborator","operationId":"remove_company_github_collaborator_companies__company_id__github_collaborators__github_username__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"github_username","in":"path","required":true,"schema":{"type":"string","title":"Github Username"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/vercel":{"get":{"tags":["vercel"],"summary":"Get Vercel Info","description":"Get Vercel project info for a company.","operationId":"get_vercel_info_companies__company_id__vercel_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VercelProjectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/site":{"patch":{"tags":["vercel"],"summary":"Set Site Paused","description":"Owner 'Pause website' toggle (same shape as PATCH /selling).\n\nIdempotent — re-PATCHing retries a failed custom-domain move.","operationId":"set_site_paused_companies__company_id__site_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSitePausedRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SitePauseStateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/vercel/provision":{"post":{"tags":["vercel"],"summary":"Provision Vercel Project","description":"Manually trigger Vercel project provisioning for a company.","operationId":"provision_vercel_project_companies__company_id__vercel_provision_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResourceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/vercel/env":{"post":{"tags":["vercel"],"summary":"Set Vercel Env Vars","description":"Set environment variables on the company's Vercel project.","operationId":"set_vercel_env_vars_companies__company_id__vercel_env_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetVercelEnvVarsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Vercel Env Vars Companies  Company Id  Vercel Env Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["vercel"],"summary":"List Vercel Env Vars","description":"List environment variable keys (values hidden).","operationId":"list_vercel_env_vars_companies__company_id__vercel_env_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VercelEnvVarResponse"},"title":"Response List Vercel Env Vars Companies  Company Id  Vercel Env Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/custom-domain/verify":{"post":{"tags":["vercel"],"summary":"Verify Custom Domain","description":"Check DNS verification status for a company's custom domain.","operationId":"verify_custom_domain_companies__company_id__custom_domain_verify_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomDomainVerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/github":{"post":{"tags":["webhooks"],"summary":"Handle Github Webhook","description":"Handle GitHub App webhook events (push → Vercel deployment).","operationId":"handle_github_webhook_webhooks_github_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Handle Github Webhook Webhooks Github Post"}}}}}}},"/webhooks/resend/email":{"post":{"tags":["webhooks"],"summary":"Handle Resend Webhook","description":"Handle inbound email from Resend (Svix-signed webhook).","operationId":"handle_resend_webhook_webhooks_resend_email_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Handle Resend Webhook Webhooks Resend Email Post"}}}}}}},"/webhooks/intercom":{"post":{"tags":["webhooks"],"summary":"Handle Intercom Webhook","description":"Mirror an Intercom conversation event into its Slack thread.","operationId":"handle_intercom_webhook_webhooks_intercom_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Handle Intercom Webhook Webhooks Intercom Post"}}}}}},"head":{"tags":["webhooks"],"summary":"Intercom Webhook Head","description":"Intercom validates the endpoint URL with a HEAD request.","operationId":"intercom_webhook_head_webhooks_intercom_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/webhooks/slack/events":{"post":{"tags":["webhooks"],"summary":"Handle Slack Event","description":"ACK Slack events fast; relay thread replies to Intercom in the background.","operationId":"handle_slack_event_webhooks_slack_events_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Handle Slack Event Webhooks Slack Events Post"}}}}}}},"/companies/{company_id}/stripe/products":{"get":{"tags":["stripe"],"summary":"List Products","description":"List Stripe products for a company, each with its per-product checkout links.","operationId":"list_products_companies__company_id__stripe_products_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Active Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeProductListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/selling":{"patch":{"tags":["stripe"],"summary":"Set Selling Paused","description":"Owner master 'Pause selling' toggle — gates every checkout of the company.\n\nStripe objects stay active; the public /c/{slug} routes read the flag live.\nOwner-only (no agent tool exists for this). Idempotent.","operationId":"set_selling_paused_companies__company_id__selling_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellingPauseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellingPauseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/products/{product_id}/selling":{"patch":{"tags":["stripe"],"summary":"Set Product Selling Paused","description":"Owner per-product selling pause — gates the product's dedicated checkout link.\n\nFlips ``paused`` on the product's checkout rows (live + test). The product\nstays sellable through the bundled standard checkout (accepted, documented —\nthe master switch is the \"nothing buyable\" control). Self-heals missing\ncheckout rows first (the ~5s provisioning window). Idempotent.","operationId":"set_product_selling_paused_companies__company_id__products__product_id__selling_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Product Id"}},{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellingPauseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSellingPauseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/stripe/payment-link":{"get":{"tags":["stripe"],"summary":"Get Payment Link","description":"Get the active payment link for a company.","operationId":"get_payment_link_companies__company_id__stripe_payment_link_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/StripePaymentLinkResponse"},{"type":"null"}],"title":"Response Get Payment Link Companies  Company Id  Stripe Payment Link Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/stripe/revenue":{"get":{"tags":["stripe"],"summary":"Get Revenue","description":"Get revenue summary for a company.","operationId":"get_revenue_companies__company_id__stripe_revenue_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeRevenueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/stripe/webhook-deliveries":{"get":{"tags":["stripe"],"summary":"List Webhook Deliveries","description":"List recent webhook deliveries for a company (for debugging).","operationId":"list_webhook_deliveries_companies__company_id__stripe_webhook_deliveries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeWebhookDeliveryListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/earnings":{"get":{"tags":["stripe"],"summary":"Get Company Earnings","description":"Sales per UTC day over a trailing 7- or 30-day window.\n\nFeeds the Money hero's sparkline and week total. Distinct from\n``/stripe/revenue`` (an all-time scalar) and from the transactions list\n(capped, so it cannot be summed into a trustworthy total).\n\nReturns no previous-window figure — see ``EarningsSeriesResponse`` for why\nthe obvious definition of one is time-of-day biased.","operationId":"get_company_earnings_companies__company_id__earnings_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"window","in":"query","required":false,"schema":{"enum":["7d","30d"],"type":"string","default":"7d","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EarningsSeriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/transactions":{"get":{"tags":["stripe"],"summary":"List Company Transactions","description":"List a company's customer sales (newest first) with refunded flag + product names.","operationId":"list_company_transactions_companies__company_id__transactions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/transactions/{transaction_id}/refund":{"post":{"tags":["stripe"],"summary":"Refund Company Transaction","description":"Refund a customer sale in full (owner-triggered). Idempotent on repeat calls.","operationId":"refund_company_transaction_companies__company_id__transactions__transaction_id__refund_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Transaction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/stripe/checkout":{"post":{"tags":["stripe"],"summary":"Handle Stripe Checkout Webhook","description":"Platform checkout completions (now: legacy buy.stripe.com link sales).","operationId":"handle_stripe_checkout_webhook_webhooks_stripe_checkout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Handle Stripe Checkout Webhook Webhooks Stripe Checkout Post"}}}}}}},"/webhooks/stripe/checkout/test":{"post":{"tags":["stripe"],"summary":"Handle Stripe Test Checkout Webhook","description":"Platform TEST-mode (sandbox) checkout webhook. Records a test payment; never credits.","operationId":"handle_stripe_test_checkout_webhook_webhooks_stripe_checkout_test_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Handle Stripe Test Checkout Webhook Webhooks Stripe Checkout Test Post"}}}}}}},"/webhooks/stripe/mor/checkout":{"post":{"tags":["stripe"],"summary":"Handle Mor Checkout Webhook","description":"MoR checkout completions + dispute/refund alerts (§8.2/§12).\n\nVerified with the MoR secret and processed with the MoR adapter (§7), so a non-USD\nsale's PaymentIntent is read from the account that owns it. Subscribe this endpoint\n(in the MoR Stripe dashboard) to ``checkout.session.completed`` +\n``charge.dispute.created`` + ``charge.dispute.updated`` + ``charge.dispute.closed`` +\n``charge.refunded``.","operationId":"handle_mor_checkout_webhook_webhooks_stripe_mor_checkout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Handle Mor Checkout Webhook Webhooks Stripe Mor Checkout Post"}}}}}}},"/webhooks/stripe/mor/checkout/test":{"post":{"tags":["stripe"],"summary":"Handle Mor Test Checkout Webhook","description":"MoR TEST-mode (sandbox) checkout webhook. Records a test payment; never credits.","operationId":"handle_mor_test_checkout_webhook_webhooks_stripe_mor_checkout_test_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Handle Mor Test Checkout Webhook Webhooks Stripe Mor Checkout Test Post"}}}}}}},"/webhooks/stripe":{"post":{"tags":["stripe"],"summary":"Handle Stripe Subscription Webhook","description":"Subscription events + the §8.5 sale fall-through (platform account).\n\nHandles: checkout.session.completed, customer.subscription.updated,\ncustomer.subscription.deleted, invoice.paid, invoice.payment_failed.","operationId":"handle_stripe_subscription_webhook_webhooks_stripe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Handle Stripe Subscription Webhook Webhooks Stripe Post"}}}}}}},"/webhooks/stripe/connect":{"post":{"tags":["stripe"],"summary":"Handle Stripe Connect Webhook","description":"Connect (Express account) webhook endpoint. Handles: account.updated.","operationId":"handle_stripe_connect_webhook_webhooks_stripe_connect_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Handle Stripe Connect Webhook Webhooks Stripe Connect Post"}}}}}}},"/conglomerates/{conglomerate_id}/checkout-session":{"post":{"tags":["subscriptions"],"summary":"Create Checkout Session","description":"Create a Stripe Checkout session for a new subscription (Founder or Light).","operationId":"create_checkout_session_conglomerates__conglomerate_id__checkout_session_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}},{"name":"X-Posthog-Session-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Posthog-Session-Id"}},{"name":"X-Client-Mobile","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Client-Mobile"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conglomerates/{conglomerate_id}/topup-checkout-session":{"post":{"tags":["subscriptions"],"summary":"Create Topup Checkout Session","description":"Create a Stripe Checkout session for a one-time credit top-up.\n\nEligibility (DRAFT_SPEC_TRIAL_TOPUP §3): active subscription past the\nfirst invoice, OR a running plan clock (trial / churn wind-down). The\nStripe customer is created on the fly for clock-path buyers.","operationId":"create_topup_checkout_session_conglomerates__conglomerate_id__topup_checkout_session_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}},{"name":"X-Posthog-Session-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Posthog-Session-Id"}},{"name":"X-Client-Mobile","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Client-Mobile"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTopupCheckoutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conglomerates/{conglomerate_id}/update-subscription":{"post":{"tags":["subscriptions"],"summary":"Update Subscription","description":"Change credit amount for an existing subscription (upgrade or downgrade).","operationId":"update_subscription_conglomerates__conglomerate_id__update_subscription_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSubscriptionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSubscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conglomerates/{conglomerate_id}/auto-topup-settings":{"put":{"tags":["subscriptions"],"summary":"Update Auto Topup Settings","description":"Arm or disarm auto top-up (spec 2026-07-01_SPEC_AUTO_TOPUP).\n\nEnabling requires the manual top-up eligibility plus a resolvable saved\npayment method, and records consent (``auto_topup_acknowledged_at``).\nDisabling is always allowed.","operationId":"update_auto_topup_settings_conglomerates__conglomerate_id__auto_topup_settings_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopupSettingsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopupSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conglomerates/{conglomerate_id}/downgrade-to-light":{"post":{"tags":["subscriptions"],"summary":"Downgrade To Light","description":"Schedule a Founder→Light switch at period end (the cancel-flow offer).","operationId":"downgrade_to_light_conglomerates__conglomerate_id__downgrade_to_light_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DowngradeToLightResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conglomerates/{conglomerate_id}/downgrade-to-light/undo":{"post":{"tags":["subscriptions"],"summary":"Undo Downgrade To Light","description":"Release a pending Founder→Light schedule (outcome A's keep-Founder undo).","operationId":"undo_downgrade_to_light_conglomerates__conglomerate_id__downgrade_to_light_undo_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DowngradeToLightResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conglomerates/{conglomerate_id}/subscription/cancel":{"post":{"tags":["subscriptions"],"summary":"Cancel Subscription At Period End","description":"Schedule a full cancellation at period end — the in-app cancel funnel's\nterminal action (the Stripe portal's native cancellation is disabled).","operationId":"cancel_subscription_at_period_end_conglomerates__conglomerate_id__subscription_cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSubscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conglomerates/{conglomerate_id}/subscription/cancel/undo":{"post":{"tags":["subscriptions"],"summary":"Undo Scheduled Cancellation","description":"Release a pending period-end cancellation — tier-agnostic \"keep your\nplan\" (specs/DRAFT_SPEC_LIGHT_CANCEL.md R4).","operationId":"undo_scheduled_cancellation_conglomerates__conglomerate_id__subscription_cancel_undo_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSubscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conglomerates/{conglomerate_id}/light-survivor":{"post":{"tags":["subscriptions"],"summary":"Select Light Survivor","description":"Owner-chosen survivor at Light activation: park every other active company.\n\nNever auto-picked (DRAFT_SPEC_LIGHT_PLAN §2 reconciliation) — this\nendpoint only ever runs on an explicit owner choice, from the picker\nmodal (active survivor) or the swap dialog (paused company revived\ninto the survivor slot).","operationId":"select_light_survivor_conglomerates__conglomerate_id__light_survivor_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LightSurvivorRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LightSurvivorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conglomerates/{conglomerate_id}/customer-portal":{"post":{"tags":["subscriptions"],"summary":"Create Customer Portal","description":"Get a Stripe Customer Portal URL (portal home, or a deep-linked flow).","operationId":"create_customer_portal_conglomerates__conglomerate_id__customer_portal_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CustomerPortalRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPortalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conglomerates/{conglomerate_id}/subscription":{"get":{"tags":["subscriptions"],"summary":"Get Subscription Info","description":"Get current subscription info.","operationId":"get_subscription_info_conglomerates__conglomerate_id__subscription_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionInfoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/margot/actions/account_summary":{"post":{"tags":["margot"],"summary":"Account Summary","description":"Plan/subscription status, credit balance, and the caller's companies.","operationId":"account_summary_margot_actions_account_summary_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MargotActionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/margot/actions/credit_ledger":{"post":{"tags":["margot"],"summary":"Credit Ledger","description":"Recent credit grants/usage for the caller's conglomerate.","operationId":"credit_ledger_margot_actions_credit_ledger_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MargotActionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/core__schemas__support__CreditLedgerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/margot/actions/company_activity":{"post":{"tags":["margot"],"summary":"Company Activity","description":"Task rollup + recent agent runs for one of the caller's companies.","operationId":"company_activity_margot_actions_company_activity_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MargotActionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyActivityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/margot/actions/product_analytics":{"post":{"tags":["margot"],"summary":"Product Analytics","description":"The caller's own product-analytics summary (last 30 days).","operationId":"product_analytics_margot_actions_product_analytics_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MargotActionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductAnalyticsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/margot/actions/raise_daily_cap":{"post":{"tags":["margot"],"summary":"Raise Daily Cap","description":"Raise the caller's conglomerate-wide daily credit cap — Margot's only write action.\n\nUnblocks the very common \"I have credits but no tasks run\" case where the 24h\ncap is the bottleneck. The decision is ``core.billing.resolve_support_daily_cap``\n(shared with the nanocorp-internal write path): raise-only, never re-imposes a\nfinite cap on an unlimited (0) conglomerate, clamped to\n``SUPPORT_DAILY_CAP_CEILING``, and — since Fin extracts this number from\nuntrusted customer text — a non-finite ask resolves to no change rather than to\na NaN cap that would disable the limit outright. An ask above the ceiling flags\n``clamped`` so Fin can offer a human for anything higher.","operationId":"raise_daily_cap_margot_actions_raise_daily_cap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RaiseDailyCapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RaiseDailyCapResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/margot/actions/known_incidents":{"post":{"tags":["margot"],"summary":"Known Incidents","description":"Curated, customer-safe known incidents (NOT raw Sentry).","operationId":"known_incidents_margot_actions_known_incidents_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MargotActionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnownIncidentsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/companies/{company_id}/referrals/stats":{"get":{"tags":["referrals"],"summary":"Referral Stats","description":"Get referral stats for a company.","operationId":"referral_stats_companies__company_id__referrals_stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/companies/{company_id}/tasks":{"post":{"tags":["internal"],"summary":"Internal Create Task","description":"Create a task (used by CEO MCP tool).","operationId":"internal_create_task_internal_companies__company_id__tasks_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalCreateTaskRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["internal"],"summary":"Internal List Tasks","description":"List tasks for a company (used by heartbeat to find work).","operationId":"internal_list_tasks_internal_companies__company_id__tasks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/tasks/{task_id}/status":{"put":{"tags":["internal"],"summary":"Internal Update Task Status","description":"Update task status (used by agents during execution).","operationId":"internal_update_task_status_internal_tasks__task_id__status_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskStatusRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/tasks/{task_id}":{"get":{"tags":["internal"],"summary":"Internal Get Task","description":"Get a single task by ID (used by worker entrypoint).","operationId":"internal_get_task_internal_tasks__task_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/runs/{run_id}/messages":{"post":{"tags":["internal"],"summary":"Internal Post Run Message","description":"Post an execution log message to a run.\n\nReturns immediately after auth — DB write + activity logging run in background.","operationId":"internal_post_run_message_internal_runs__run_id__messages_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRunMessageRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunMessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/runs/{run_id}/stats":{"put":{"tags":["internal"],"summary":"Internal Update Run Stats","description":"Update token/cost stats on a run (for margin monitoring).\n\nCredit deduction happens at task pickup, not here.\nThis endpoint only records cost_usd for internal tracking.","operationId":"internal_update_run_stats_internal_runs__run_id__stats_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRunStatsRequest"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/runs/{run_id}/trace":{"put":{"tags":["internal"],"summary":"Internal Upload Run Trace","description":"Upload a raw JSONL trace file for a run.\n\nAccepts the raw file bytes as the request body (application/octet-stream).\nDelegates to save_run_trace() for validation and storage.","operationId":"internal_upload_run_trace_internal_runs__run_id__trace_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}},{"name":"filename","in":"query","required":false,"schema":{"type":"string","default":"trace.jsonl","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Internal Upload Run Trace Internal Runs  Run Id  Trace Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/runs/{run_id}/transcript-entries":{"post":{"tags":["internal"],"summary":"Append Transcript Entries","description":"SessionStore.append: idempotent batch mirror (uuid dedup in the DB).","operationId":"append_transcript_entries_internal_runs__run_id__transcript_entries_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptAppendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptAppendResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["internal"],"summary":"Load Transcript Entries","description":"SessionStore.load: the full transcript for (session, subpath), id order.","operationId":"load_transcript_entries_internal_runs__run_id__transcript_entries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}},{"name":"subpath","in":"query","required":false,"schema":{"type":"string","maxLength":512,"default":"","title":"Subpath"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptLoadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/runs/{run_id}/transcript-subpaths":{"get":{"tags":["internal"],"summary":"List Transcript Subpaths","description":"SessionStore.list_subkeys: non-empty subpaths only (the SDK rejects '').","operationId":"list_transcript_subpaths_internal_runs__run_id__transcript_subpaths_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptSubpathsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/runs/{run_id}/session-context":{"get":{"tags":["internal"],"summary":"Get Session Context","description":"Everything the entrypoint needs for this turn: the frozen system prompt\n(decision 13, read from the session row), the verbatim user message, the\nresume key, the reset-banner flag (decision 12) and the model.","operationId":"get_session_context_internal_runs__run_id__session_context_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnContextResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/runs/{run_id}/turn":{"patch":{"tags":["internal"],"summary":"Patch Turn","description":"Turn-status PATCH: the entrypoint reports how the turn ended, and (turn 1)\nthe captured sdk_session_id. Terminal statuses release the session lock by\nconstruction (the partial unique index only covers pending/running).\n\nRace shape (final review, three iterations): a finalize request carries\nits resume-key mutation INSIDE the transition statement (one atomic CTE)\n— the mutation applies iff that request wins the active→terminal\ntransition, and both commit together, so there is no window between the\nkey landing/withdrawing and the lock releasing, and a swept zombie's\nfinalize applies nothing. Bare mutations (the init-time background\nPATCH) are terminal-fenced with a fresh status read, and their set is\nadditionally guarded on the run still being active inside the UPDATE —\na stalled bare set racing the atomic finalize either lands before it\n(an owning clear overwrites it; an owning set finds the slot taken —\nfirst-writer-wins, same key) or after it (guard fails, no-op).","operationId":"patch_turn_internal_runs__run_id__turn_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnPatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnControlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/runs/{run_id}/control":{"get":{"tags":["internal"],"summary":"Get Turn Control","description":"The turn control-signal poll. Alpha payload: {interrupt} — one route\nshaped to carry later signals (e.g. next_message for warm reuse).","operationId":"get_turn_control_internal_runs__run_id__control_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnControlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/tools":{"get":{"tags":["internal"],"summary":"List Tools","description":"List available tools (any authenticated principal).","operationId":"list_tools_internal_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolListResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/internal/tools/{tool_name}/execute":{"post":{"tags":["internal"],"summary":"Execute Tool","description":"Execute a tool against the resolved, already-authorized target company.\n\nThe company comes from the request (``Nanocorp-Company`` header for a user\nprincipal, or the key's own company for a company principal), not from the\ncredential — see ``resolve_target_company_id``.","operationId":"execute_tool_internal_tools__tool_name__execute_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tool_name","in":"path","required":true,"schema":{"type":"string","title":"Tool Name"}},{"name":"Nanocorp-Company","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nanocorp-Company"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteToolRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/otel/v1/traces":{"post":{"tags":["internal"],"summary":"Otel Traces","description":"Forward an OTLP /v1/traces batch to Langfuse with auth swap.\n\nReturns 202 immediately and forwards to Langfuse as a background task.\nStarlette runs background tasks only after the response is flushed, so the\nworker's OTLP exporter receives the 202 without blocking on the ~10s\nLangfuse round-trip. Langfuse errors are swallowed and reported to Sentry\nso a downstream outage never breaks worker runs (fire-and-forget tracing).","operationId":"otel_traces_internal_otel_v1_traces_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/internal/companies/{company_id}/stripe/products":{"post":{"tags":["internal"],"summary":"Create Product","description":"Create a Stripe product (agent auth) on the configured sale account (MoR post-swap).","operationId":"create_product_internal_companies__company_id__stripe_products_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStripeProductRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeProductResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["internal"],"summary":"List Products","description":"List Stripe products (agent auth), each with its per-product checkout links.","operationId":"list_products_internal_companies__company_id__stripe_products_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Active Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeProductListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/companies/{company_id}/stripe/payment-link":{"get":{"tags":["internal"],"summary":"Get Payment Link","description":"Get the active payment link (agent auth).","operationId":"get_payment_link_internal_companies__company_id__stripe_payment_link_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/StripePaymentLinkResponse"},{"type":"null"}],"title":"Response Get Payment Link Internal Companies  Company Id  Stripe Payment Link Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/companies/{company_id}/stripe/revenue":{"get":{"tags":["internal"],"summary":"Get Revenue","description":"Get revenue summary (agent auth).","operationId":"get_revenue_internal_companies__company_id__stripe_revenue_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeRevenueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/service/raise_daily_cap":{"post":{"tags":["internal"],"summary":"Raise Daily Cap","description":"Raise a conglomerate's daily credit cap — the internal platform's only write.\n\nThe decision is ``core.billing.resolve_support_daily_cap`` — the same function\n``margot_actions.raise_daily_cap`` calls, not a copy of it, so the two surfaces\ncannot drift: raise-only (never lowers), never re-imposes a finite cap on an\nunlimited (0) conglomerate, clamped to ``SUPPORT_DAILY_CAP_CEILING``, and a\nnon-finite ask (NaN/±inf, which would defeat every comparison and land an\n*uncapped* row) resolves to no change. Worst case for a compromised internal\nservice is therefore nudging a 24h *rate* limit up to the ceiling — real spend\nstays bounded by the credit balance.\n\n``clamped`` flags an ask above the ceiling so the caller can offer a human.\n``changed`` reflects the value actually persisted, so it is False for every\nno-op. Unknown conglomerate → 404.","operationId":"raise_daily_cap_internal_service_raise_daily_cap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RaiseDailyCapServiceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RaiseDailyCapServiceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/users/me/onboarding":{"get":{"tags":["users"],"summary":"Get Onboarding Status","description":"Return the list of completed onboarding step keys for the current user.","operationId":"get_onboarding_status_users_me_onboarding_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingStatusResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["users"],"summary":"Complete Onboarding Step","description":"Mark an onboarding step as completed and return the updated list.","operationId":"complete_onboarding_step_users_me_onboarding_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteOnboardingStepRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/users/me/x-verify":{"post":{"tags":["users"],"summary":"X Verify","description":"Search X for the user's verification code and grant 5 bonus credits.","operationId":"x_verify_users_me_x_verify_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XVerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me/x-onboarding-shown":{"put":{"tags":["users"],"summary":"X Onboarding Shown","description":"Mark the X onboarding modal as shown/dismissed.","operationId":"x_onboarding_shown_users_me_x_onboarding_shown_put","responses":{"204":{"description":"Successful Response"}},"security":[{"HTTPBearer":[]}]}},"/feature-requests":{"post":{"tags":["feature-requests"],"summary":"Create Feature Request","description":"Send the user's feature request to the team's Slack channel.","operationId":"create_feature_request_feature_requests_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureRequestCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureRequestAck"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/companies/{company_id}/withdrawal-requests":{"post":{"tags":["withdrawals"],"summary":"Create Withdrawal Request","description":"Submit (or idempotently return the in-progress) withdrawal request for a company.","operationId":"create_withdrawal_request_companies__company_id__withdrawal_requests_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawalCreateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["withdrawals"],"summary":"List Withdrawal Requests","description":"List the open withdrawal request (if any) + last 10 historical for a company.","operationId":"list_withdrawal_requests_companies__company_id__withdrawal_requests_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawalListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/withdraw/onboard":{"get":{"tags":["withdrawals"],"summary":"Withdraw Onboard Redirect","description":"Mint a fresh Stripe onboarding link on demand.\n\nThe frontend page at `/withdraw/onboard` calls this endpoint with the\ncurrent user's JWT, then redirects the browser to the returned URL.\nThat indirection lets us send durable links in emails / Stripe\n`refresh_url` even though the Stripe account links themselves are\nshort-lived and single-use.","operationId":"withdraw_onboard_redirect_withdraw_onboard_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conglomerate_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Conglomerate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/public/live/city":{"get":{"tags":["public"],"summary":"Get Live City","description":"Public Nano City data — every non-archived company, lean. No auth.","operationId":"get_live_city_api_public_live_city_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/public/live/competition":{"get":{"tags":["public"],"summary":"Get Live Competition","description":"Public competition leaderboard (The Revenue Race) — no auth.","operationId":"get_live_competition_api_public_live_competition_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/public/live/dashboard":{"get":{"tags":["public"],"summary":"Get Live Dashboard","description":"Public live dashboard — no auth required.","operationId":"get_live_dashboard_api_public_live_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/public/badge/{handle}.js":{"get":{"tags":["public"],"summary":"Badge Script","description":"Chip JS for free-tier sites, a no-op for everyone else. Always 200.","operationId":"badge_script_public_badge__handle__js_get","parameters":[{"name":"handle","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"description":"Company handle","title":"Handle"},"description":"Company handle"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/site-status/{handle}":{"get":{"tags":["public"],"summary":"Site Status","description":"Serving state for a company site. Always 200, always fail-open.","operationId":"site_status_public_site_status__handle__get","parameters":[{"name":"handle","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"description":"Company handle","title":"Handle"},"description":"Company handle"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/companies/{company_id}/app-users/is-owner":{"post":{"tags":["app-users"],"summary":"App Users Is Owner","description":"D-47: the live owner authority behind ``requireOwner()``.\n\nAuthenticated with the company's own ``NANOCORP_TOKEN`` — the credential\n(not a query predicate) carries the tenant dimension of D-57: the path\ncompany must equal the key's company (``authorize_company_path``). The\n``/internal/`` prefix is convention; the enforcement is this dependency.\nThe ``is_app_owner`` claim in tokens/cookies is a rendering hint only —\nTHIS answer is the authority for mutations.","operationId":"app_users_is_owner_internal_companies__company_id__app_users_is_owner_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IsOwnerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IsOwnerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/companies/{company_id}/app-users":{"get":{"tags":["app-users"],"summary":"List App Users","description":"The Users card / ``list_app_users`` roster (D-19).\n\nSoft-deleted users are excluded (§10: support erasure must not leave a\nghost on the owner roster). These are SIGN-IN IDENTITIES, not a marketing\nlist — the tool description and ToS carry the matching obligation.","operationId":"list_app_users_companies__company_id__app_users_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Company Id"}},{"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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppUsersListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AccountSummaryResponse":{"properties":{"found":{"type":"boolean","title":"Found","default":true},"conglomerate_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conglomerate Name"},"plan_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Tier"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"},"credit_balance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credit Balance"},"max_daily_credits":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Daily Credits"},"credits_used_today":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credits Used Today"},"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End"},"total_companies":{"type":"integer","title":"Total Companies","default":0},"companies":{"items":{"$ref":"#/components/schemas/CompanySummary"},"type":"array","title":"Companies"}},"type":"object","title":"AccountSummaryResponse"},"ActivityEventResponse":{"properties":{"id":{"type":"string","title":"Id"},"event_type":{"type":"string","title":"Event Type"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","event_type","title","created_at"],"title":"ActivityEventResponse"},"ActivityListResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/ActivityEventResponse"},"type":"array","title":"Events"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["events","has_more"],"title":"ActivityListResponse"},"AddCollaboratorRequest":{"properties":{"github_username":{"type":"string","title":"Github Username"}},"type":"object","required":["github_username"],"title":"AddCollaboratorRequest"},"AnalyticsCountries":{"properties":{"range":{"type":"string","enum":["1d","7d","30d","90d"],"title":"Range"},"since":{"type":"string","format":"date-time","title":"Since"},"until":{"type":"string","format":"date-time","title":"Until"},"total_known":{"type":"integer","title":"Total Known"},"total_unknown":{"type":"integer","title":"Total Unknown"},"countries":{"items":{"$ref":"#/components/schemas/CountryRow"},"type":"array","title":"Countries"}},"type":"object","required":["range","since","until","total_known","total_unknown","countries"],"title":"AnalyticsCountries","description":"Visitors-by-country breakdown for the owner dashboard map.\n\n`total_known` is the sum of visitors across all entries in ``countries``;\n`total_unknown` aggregates visitors whose IP could not be resolved to a\ncountry (private/loopback IP, unrecognized IP, or NULL IP). Surfaced\nseparately so the choropleth doesn't show a phantom \"Unknown\" country."},"AnalyticsSummary":{"properties":{"range":{"type":"string","enum":["1d","7d","30d","90d"],"title":"Range"},"since":{"type":"string","format":"date-time","title":"Since"},"until":{"type":"string","format":"date-time","title":"Until"},"granularity":{"type":"string","enum":["hour","day"],"title":"Granularity"},"visitors":{"type":"integer","title":"Visitors"},"pageviews":{"type":"integer","title":"Pageviews"},"sessions":{"type":"integer","title":"Sessions"},"trend":{"items":{"$ref":"#/components/schemas/TrendPoint"},"type":"array","title":"Trend"}},"type":"object","required":["range","since","until","granularity","visitors","pageviews","sessions","trend"],"title":"AnalyticsSummary","description":"Headline KPIs + zero-filled trend line for the owner dashboard."},"AnswerFoundingRequest":{"properties":{"question_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Question Id"},"selected_option_ids":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":4},{"type":"null"}],"title":"Selected Option Ids"},"text":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}],"title":"Text"},"skip":{"type":"boolean","title":"Skip","default":false},"had_discarded_text":{"type":"boolean","title":"Had Discarded Text","default":false},"is_section_edit":{"type":"boolean","title":"Is Section Edit","default":false},"trigger":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Trigger"}},"type":"object","title":"AnswerFoundingRequest","description":"The body of ``POST /founding/{id}/turn``.\n\nFour shapes in one schema, all optional, because the route is one idempotent\nentry point: a chosen option, composer text resolving a pending question, a\nplain message after a textual end_turn, or an **empty body** — the kick that\nstarts the first segment, retries a dead one, and retries a failed founding."},"AppUserResponse":{"properties":{"sub":{"type":"string","title":"Sub"},"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"picture":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Picture"},"granted_at":{"type":"string","format":"date-time","title":"Granted At"},"last_login_at":{"type":"string","format":"date-time","title":"Last Login At"}},"type":"object","required":["sub","email","granted_at","last_login_at"],"title":"AppUserResponse","description":"One end-user who signed in to the company's app. These are sign-in\nidentities, not a marketing list (§10)."},"AppUsersListResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/AppUserResponse"},"type":"array","title":"Users"},"total":{"type":"integer","title":"Total"},"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["users","total","enabled"],"title":"AppUsersListResponse"},"ArchiveCompanyRequest":{"properties":{"reason_category":{"type":"string","enum":["didnt_work_out","too_expensive","just_testing","other"],"title":"Reason Category"},"reason":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Reason"}},"type":"object","required":["reason_category"],"title":"ArchiveCompanyRequest","description":"Optional body for DELETE /companies/{company_id} (archive).\n\nWhen a body is sent, ``reason_category`` is required; the whole body may be\nomitted (agent/legacy callers). Stored on the companies archive columns +\nthe ``company_archived`` PostHog event (specs/DRAFT_SPEC_COMPANY_ARCHIVE.md §4)."},"ArchivedCompanyListResponse":{"properties":{"companies":{"items":{"$ref":"#/components/schemas/ArchivedCompanyResponse"},"type":"array","title":"Companies"}},"type":"object","required":["companies"],"title":"ArchivedCompanyListResponse"},"ArchivedCompanyResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"handle":{"type":"string","title":"Handle"},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Archived At"},"lifetime_earnings_cents":{"type":"integer","title":"Lifetime Earnings Cents","default":0},"balance_real_cents":{"type":"integer","title":"Balance Real Cents","default":0}},"type":"object","required":["id","name","handle"],"title":"ArchivedCompanyResponse","description":"One row of the settings \"Archived companies\" list (archive spec §8).\n\nDeliberately lean: no company pages exist for archived companies — only the\nmoney path (balance + the allowlisted withdrawal routes) stays reachable.\n``archived_at`` is None for rows archived before the forensics columns shipped."},"AttachedCompanyRef":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"AttachedCompanyRef"},"AutoTopupSettingsRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"credits":{"type":"integer","title":"Credits"}},"type":"object","required":["enabled","credits"],"title":"AutoTopupSettingsRequest"},"AutoTopupSettingsResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"credits":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits"},"disabled_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disabled Reason"},"threshold":{"type":"number","title":"Threshold"},"daily_cap":{"type":"integer","title":"Daily Cap"}},"type":"object","required":["enabled","credits","disabled_reason","threshold","daily_cap"],"title":"AutoTopupSettingsResponse"},"CancelSubscriptionResponse":{"properties":{"status":{"type":"string","title":"Status"},"effective_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective At"}},"type":"object","required":["status","effective_at"],"title":"CancelSubscriptionResponse"},"ChatMessageResponse":{"properties":{"id":{"type":"string","title":"Id"},"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"},"tool_calls":{"anyOf":[{"items":{"$ref":"#/components/schemas/ToolCallInfo"},"type":"array"},{"type":"null"}],"title":"Tool Calls"},"token_count_input":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Token Count Input"},"token_count_output":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Token Count Output"},"cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Usd"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","role","content","created_at"],"title":"ChatMessageResponse"},"CliStartResponse":{"properties":{"authorization_url":{"type":"string","title":"Authorization Url"}},"type":"object","required":["authorization_url"],"title":"CliStartResponse"},"CliTokenRequest":{"properties":{"code":{"type":"string","title":"Code"},"code_verifier":{"type":"string","title":"Code Verifier"}},"type":"object","required":["code","code_verifier"],"title":"CliTokenRequest"},"CliTokenResponse":{"properties":{"token":{"type":"string","title":"Token"},"user_email":{"type":"string","title":"User Email"},"conglomerate_id":{"type":"string","title":"Conglomerate Id"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["token","user_email","conglomerate_id"],"title":"CliTokenResponse"},"CollaboratorResponse":{"properties":{"id":{"type":"string","title":"Id"},"github_username":{"type":"string","title":"Github Username"},"status":{"type":"string","title":"Status"},"invited_at":{"type":"string","format":"date-time","title":"Invited At"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Accepted At"}},"type":"object","required":["id","github_username","status","invited_at"],"title":"CollaboratorResponse"},"CompanyActivityResponse":{"properties":{"found":{"type":"boolean","title":"Found","default":true},"company":{"anyOf":[{"$ref":"#/components/schemas/CompanySummary"},{"type":"null"}]},"task_summary":{"additionalProperties":{"type":"integer"},"type":"object","title":"Task Summary"},"total_tasks":{"type":"integer","title":"Total Tasks","default":0},"recent_runs":{"items":{"$ref":"#/components/schemas/RunSummary"},"type":"array","title":"Recent Runs"}},"type":"object","title":"CompanyActivityResponse"},"CompanyApiKeyResponse":{"properties":{"token":{"type":"string","title":"Token"},"key_prefix":{"type":"string","title":"Key Prefix"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["token","key_prefix","created_at"],"title":"CompanyApiKeyResponse","description":"The company's permanent API key (2026-08-07 spec §6).\n\nThe raw ``token`` is returned to the owner on every read (D-9): it is the\nowner's own credential and every sandbox env already carries it. Responses\nare served with ``Cache-Control: no-store``."},"CompanyFileResponse":{"properties":{"id":{"type":"string","title":"Id"},"path":{"type":"string","title":"Path"},"size_bytes":{"type":"integer","title":"Size Bytes"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","path","size_bytes","content_type","created_at","updated_at"],"title":"CompanyFileResponse"},"CompanyListResponse":{"properties":{"companies":{"items":{"$ref":"#/components/schemas/CompanyResponse"},"type":"array","title":"Companies"}},"type":"object","required":["companies"],"title":"CompanyListResponse"},"CompanyResourceResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"resource_type":{"type":"string","title":"Resource Type"},"status":{"type":"string","title":"Status"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"external_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Url"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","company_id","resource_type","status","created_at","updated_at"],"title":"CompanyResourceResponse"},"CompanyResourceStatus":{"properties":{"type":{"type":"string","title":"Type"},"status":{"type":"string","title":"Status"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","required":["type","status"],"title":"CompanyResourceStatus","description":"One infrastructure resource's provisioning status."},"CompanyResourcesResponse":{"properties":{"resources":{"items":{"$ref":"#/components/schemas/CompanyResourceStatus"},"type":"array","title":"Resources"}},"type":"object","required":["resources"],"title":"CompanyResourcesResponse","description":"The three canonical infra resources for a company, in a stable order so the\nCLI's 3-line provisioning poll (repo / database / site) is deterministic. A\nresource whose row does not exist yet is reported as ``not_provisioned``."},"CompanyResponse":{"properties":{"id":{"type":"string","title":"Id"},"conglomerate_id":{"type":"string","title":"Conglomerate Id"},"name":{"type":"string","title":"Name"},"handle":{"type":"string","title":"Handle"},"one_liner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"One Liner"},"mission":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mission"},"initial_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initial Prompt"},"status":{"$ref":"#/components/schemas/CompanyStatus"},"balance_cents":{"type":"integer","title":"Balance Cents","default":0},"balance_real_cents":{"type":"integer","title":"Balance Real Cents","default":0},"github_repo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Github Repo Url"},"github_repo_full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Github Repo Full Name"},"cycle_interval_seconds":{"type":"integer","title":"Cycle Interval Seconds","default":86400},"max_daily_tasks":{"type":"integer","title":"Max Daily Tasks","default":5},"tasks_used_today":{"type":"integer","title":"Tasks Used Today","default":0},"harness_version":{"type":"number","title":"Harness Version","default":2},"custom_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Domain"},"custom_domain_verified":{"type":"boolean","title":"Custom Domain Verified","default":false},"website_url":{"type":"string","title":"Website Url","default":""},"outbound_email_paused":{"type":"boolean","title":"Outbound Email Paused","default":false},"outbound_prospect_search_paused":{"type":"boolean","title":"Outbound Prospect Search Paused","default":false},"selling_paused":{"type":"boolean","title":"Selling Paused","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","conglomerate_id","name","handle","status","created_at","updated_at"],"title":"CompanyResponse"},"CompanyStatus":{"type":"string","enum":["draft","active","paused","archived"],"title":"CompanyStatus"},"CompanySummary":{"properties":{"name":{"type":"string","title":"Name"},"handle":{"type":"string","title":"Handle"},"status":{"type":"string","title":"Status"},"custom_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Domain"},"custom_domain_verified":{"type":"boolean","title":"Custom Domain Verified","default":false}},"type":"object","required":["name","handle","status"],"title":"CompanySummary","description":"Customer-safe view of one of the caller's companies."},"CompleteOnboardingStepRequest":{"properties":{"step_key":{"type":"string","title":"Step Key"}},"type":"object","required":["step_key"],"title":"CompleteOnboardingStepRequest"},"ConglomerateListResponse":{"properties":{"conglomerates":{"items":{"$ref":"#/components/schemas/ConglomerateResponse"},"type":"array","title":"Conglomerates"}},"type":"object","required":["conglomerates"],"title":"ConglomerateListResponse"},"ConglomerateResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"max_daily_credits":{"type":"number","title":"Max Daily Credits"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","max_daily_credits","created_at","updated_at"],"title":"ConglomerateResponse"},"ConnectStatusResponse":{"properties":{"account_exists":{"type":"boolean","title":"Account Exists"},"details_submitted":{"type":"boolean","title":"Details Submitted"},"payouts_enabled":{"type":"boolean","title":"Payouts Enabled"}},"type":"object","required":["account_exists","details_submitted","payouts_enabled"],"title":"ConnectStatusResponse"},"CountryRow":{"properties":{"country_code":{"type":"string","title":"Country Code"},"country_name":{"type":"string","title":"Country Name"},"visitors":{"type":"integer","title":"Visitors"},"pageviews":{"type":"integer","title":"Pageviews"}},"type":"object","required":["country_code","country_name","visitors","pageviews"],"title":"CountryRow","description":"One country bucket on the analytics country map.\n\n`country_code` is an ISO 3166-1 alpha-2 (e.g., \"US\"); `country_name` is the\nGeoLite2-Country display name (e.g., \"United States\"). Never present for\nthe \"unknown\" bucket — that's aggregated into ``AnalyticsCountries.total_unknown``."},"CreateCheckoutRequest":{"properties":{"credits":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits"},"company_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Company Id"},"plan":{"type":"string","enum":["founder","light"],"title":"Plan","default":"founder"}},"type":"object","title":"CreateCheckoutRequest"},"CreateCheckoutResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"}},"type":"object","required":["checkout_url"],"title":"CreateCheckoutResponse"},"CreateCompanyRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"one_liner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"One Liner"},"surprise_me":{"type":"boolean","title":"Surprise Me","default":false},"handle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handle"},"mission":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mission"},"import_existing_code":{"type":"boolean","title":"Import Existing Code","default":false},"start_paused":{"type":"boolean","title":"Start Paused","default":false},"skip_moderation":{"type":"boolean","title":"Skip Moderation","default":false}},"type":"object","title":"CreateCompanyRequest"},"CreateRunMessageRequest":{"properties":{"message_type":{"type":"string","title":"Message Type","default":"log"},"content":{"type":"string","title":"Content"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["content"],"title":"CreateRunMessageRequest"},"CreateSecretRequest":{"properties":{"key":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Z][A-Z0-9_]*$","title":"Key"},"value":{"type":"string","maxLength":32768,"minLength":1,"title":"Value"},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Description"}},"type":"object","required":["key","value"],"title":"CreateSecretRequest"},"CreateSessionRequest":{"properties":{"message":{"type":"string","maxLength":50000,"minLength":1,"title":"Message"},"prompt_source":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Prompt Source"}},"type":"object","required":["message"],"title":"CreateSessionRequest"},"CreateStripeProductRequest":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"price_cents":{"type":"integer","title":"Price Cents"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"}},"type":"object","required":["name","price_cents"],"title":"CreateStripeProductRequest"},"CreateTaskRequest":{"properties":{"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"priority":{"type":"string","title":"Priority","default":"normal"},"runner":{"type":"string","title":"Runner","default":"worker_codex"}},"type":"object","required":["title"],"title":"CreateTaskRequest"},"CreateTokenRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"expires_in_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In Seconds"}},"type":"object","title":"CreateTokenRequest"},"CreateTokenResponse":{"properties":{"id":{"type":"string","title":"Id"},"token":{"type":"string","title":"Token"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"kind":{"type":"string","title":"Kind"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","token","key_prefix","kind","created_at"],"title":"CreateTokenResponse","description":"The raw ``token`` is surfaced exactly once, at creation."},"CreateTopupCheckoutRequest":{"properties":{"credits":{"type":"integer","title":"Credits"},"company_id":{"type":"string","format":"uuid","title":"Company Id"}},"type":"object","required":["credits","company_id"],"title":"CreateTopupCheckoutRequest"},"CustomDomainVerifyResponse":{"properties":{"domain":{"type":"string","title":"Domain"},"verified":{"type":"boolean","title":"Verified"},"dns_records":{"items":{"$ref":"#/components/schemas/DnsRecord"},"type":"array","title":"Dns Records","default":[]}},"type":"object","required":["domain","verified"],"title":"CustomDomainVerifyResponse"},"CustomerPortalRequest":{"properties":{"flow":{"anyOf":[{"type":"string","const":"payment_method_update"},{"type":"null"}],"title":"Flow"}},"type":"object","title":"CustomerPortalRequest"},"CustomerPortalResponse":{"properties":{"portal_url":{"type":"string","title":"Portal Url"}},"type":"object","required":["portal_url"],"title":"CustomerPortalResponse"},"DashboardResponse":{"properties":{"company":{"$ref":"#/components/schemas/CompanyResponse"},"vercel":{"$ref":"#/components/schemas/VercelProjectResponse"},"documents":{"items":{"$ref":"#/components/schemas/DocumentResponse"},"type":"array","title":"Documents"},"active_tasks":{"items":{"$ref":"#/components/schemas/TaskResponse"},"type":"array","title":"Active Tasks"},"completed_tasks":{"items":{"$ref":"#/components/schemas/TaskResponse"},"type":"array","title":"Completed Tasks"},"activity_events":{"items":{"$ref":"#/components/schemas/ActivityEventResponse"},"type":"array","title":"Activity Events"},"activity_has_more":{"type":"boolean","title":"Activity Has More"},"emails":{"items":{"$ref":"#/components/schemas/EmailSummaryResponse"},"type":"array","title":"Emails"},"email_stats":{"$ref":"#/components/schemas/EmailStatsResponse"},"chat_messages":{"items":{"$ref":"#/components/schemas/ChatMessageResponse"},"type":"array","title":"Chat Messages"},"stripe_products":{"items":{"$ref":"#/components/schemas/StripeProductResponse"},"type":"array","title":"Stripe Products"},"stripe_payment_link":{"anyOf":[{"$ref":"#/components/schemas/StripePaymentLinkResponse"},{"type":"null"}]},"stripe_revenue":{"$ref":"#/components/schemas/StripeRevenueResponse"}},"type":"object","required":["company","vercel","documents","active_tasks","completed_tasks","activity_events","activity_has_more","emails","email_stats","chat_messages","stripe_products","stripe_payment_link","stripe_revenue"],"title":"DashboardResponse"},"DayValueResponse":{"properties":{"date":{"type":"string","title":"Date"},"value":{"type":"number","title":"Value"}},"type":"object","required":["date","value"],"title":"DayValueResponse"},"DeviceStartResponse":{"properties":{"device_code":{"type":"string","title":"Device Code"},"user_code":{"type":"string","title":"User Code"},"verification_uri":{"type":"string","title":"Verification Uri"},"verification_uri_complete":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verification Uri Complete"},"interval":{"type":"integer","title":"Interval"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["device_code","user_code","verification_uri","interval","expires_in"],"title":"DeviceStartResponse"},"DeviceTokenRequest":{"properties":{"device_code":{"type":"string","title":"Device Code"}},"type":"object","required":["device_code"],"title":"DeviceTokenRequest"},"DeviceTokenResponse":{"properties":{"status":{"type":"string","title":"Status"},"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"},"user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Email"},"conglomerate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conglomerate Id"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["status"],"title":"DeviceTokenResponse","description":"``status == \"complete\"`` carries the minted token + identity; otherwise it\nis one of ``pending`` / ``slow_down`` / ``expired`` / ``denied``."},"DnsRecord":{"properties":{"type":{"type":"string","title":"Type"},"domain":{"type":"string","title":"Domain"},"value":{"type":"string","title":"Value"}},"type":"object","required":["type","domain","value"],"title":"DnsRecord"},"DocumentListResponse":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/DocumentResponse"},"type":"array","title":"Documents"}},"type":"object","required":["documents"],"title":"DocumentListResponse"},"DocumentResponse":{"properties":{"id":{"type":"string","title":"Id"},"document_type":{"type":"string","title":"Document Type"},"title":{"type":"string","title":"Title"},"content":{"type":"string","title":"Content"},"is_visible":{"type":"boolean","title":"Is Visible"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","document_type","title","content","is_visible","created_at","updated_at"],"title":"DocumentResponse"},"DomainCheckoutRequest":{"properties":{"domain":{"type":"string","maxLength":253,"minLength":3,"title":"Domain"},"quoted_price_cents":{"type":"integer","minimum":1.0,"title":"Quoted Price Cents"}},"type":"object","required":["domain","quoted_price_cents"],"title":"DomainCheckoutRequest"},"DomainCheckoutResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"}},"type":"object","required":["checkout_url"],"title":"DomainCheckoutResponse"},"DomainListResponse":{"properties":{"domains":{"items":{"$ref":"#/components/schemas/DomainPurchaseResponse"},"type":"array","title":"Domains"}},"type":"object","required":["domains"],"title":"DomainListResponse"},"DomainPurchaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"domain":{"type":"string","title":"Domain"},"status":{"type":"string","title":"Status"},"attached_company":{"anyOf":[{"$ref":"#/components/schemas/AttachedCompanyRef"},{"type":"null"}]},"live":{"type":"boolean","title":"Live","default":false},"years":{"type":"integer","title":"Years"},"price_cents":{"type":"integer","title":"Price Cents"},"renewal_price_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Renewal Price Cents"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","domain","status","years","price_cents","created_at"],"title":"DomainPurchaseResponse"},"DomainSearchResultResponse":{"properties":{"domain":{"type":"string","title":"Domain"},"available":{"type":"boolean","title":"Available"},"price_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Cents"},"renewal_price_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Renewal Price Cents"},"years":{"type":"integer","title":"Years","default":1},"purchasable":{"type":"boolean","title":"Purchasable","default":false},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["domain","available"],"title":"DomainSearchResultResponse"},"DowngradeToLightResponse":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"DowngradeToLightResponse"},"EarningsBucket":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"amount_cents":{"type":"integer","title":"Amount Cents"},"payment_count":{"type":"integer","title":"Payment Count"}},"type":"object","required":["date","amount_cents","payment_count"],"title":"EarningsBucket","description":"One UTC day of sales. Zero-sale days are present with zeros, so the series\nis always exactly ``window`` entries long and a sparkline can index it directly."},"EarningsSeriesResponse":{"properties":{"window":{"type":"string","enum":["7d","30d"],"title":"Window"},"total_cents":{"type":"integer","title":"Total Cents"},"payment_count":{"type":"integer","title":"Payment Count"},"buckets":{"items":{"$ref":"#/components/schemas/EarningsBucket"},"type":"array","title":"Buckets"}},"type":"object","required":["window","total_cents","payment_count","buckets"],"title":"EarningsSeriesResponse","description":"A company's sales over a trailing window, bucketed by UTC day.\n\nExists because the delta and the sparkline are numbers ABOUT MONEY and the\ntransactions list is capped — summing a capped page would silently\nunder-report the moment a company outgrew the page size.\n\n``total_cents`` is the window's sum over EARNING rows, matching the revenue\ntotal it sits beside.\n\nThere is deliberately NO previous-window total. The obvious definition —\nthe N calendar days before this window — compares N COMPLETE days against a\nwindow whose last day is still in progress, so a flat business reads as a\ndecline every morning and recovers by evening. Day buckets cannot express a\nphase-aligned previous window, and no caller renders a delta today, so the\nfield is left out rather than shipped biased: a wrong number about money is\nworse than no number. Add it when a caller needs it, with a query that\ncompares equal elapsed spans."},"EmailListResponse":{"properties":{"emails":{"items":{"$ref":"#/components/schemas/EmailSummaryResponse"},"type":"array","title":"Emails"}},"type":"object","required":["emails"],"title":"EmailListResponse"},"EmailResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"direction":{"type":"string","title":"Direction"},"from_address":{"type":"string","title":"From Address"},"to_address":{"type":"string","title":"To Address"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"body_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Text"},"body_html":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Html"},"is_read":{"type":"boolean","title":"Is Read"},"resend_email_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resend Email Id"},"in_reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"In Reply To"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"received_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Received At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","company_id","direction","from_address","to_address","is_read","created_at"],"title":"EmailResponse"},"EmailStatsResponse":{"properties":{"total_sent":{"type":"integer","title":"Total Sent"},"total_received":{"type":"integer","title":"Total Received"},"unread_received":{"type":"integer","title":"Unread Received","default":0}},"type":"object","required":["total_sent","total_received"],"title":"EmailStatsResponse"},"EmailSummaryResponse":{"properties":{"id":{"type":"string","title":"Id"},"direction":{"type":"string","title":"Direction"},"from_address":{"type":"string","title":"From Address"},"from_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Name"},"to_address":{"type":"string","title":"To Address"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview"},"is_read":{"type":"boolean","title":"Is Read"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"received_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Received At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","direction","from_address","to_address","is_read","created_at"],"title":"EmailSummaryResponse","description":"Lightweight email response for list endpoints (no body)."},"ExecuteToolRequest":{"properties":{"arguments":{"additionalProperties":true,"type":"object","title":"Arguments"}},"type":"object","required":["arguments"],"title":"ExecuteToolRequest"},"ExecuteToolResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success"],"title":"ExecuteToolResponse"},"FeatureRequestAck":{"properties":{"status":{"type":"string","const":"sent","title":"Status","default":"sent"}},"type":"object","title":"FeatureRequestAck"},"FeatureRequestCreate":{"properties":{"text":{"type":"string","maxLength":1000,"minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"FeatureRequestCreate"},"FileListResponse":{"properties":{"files":{"items":{"$ref":"#/components/schemas/CompanyFileResponse"},"type":"array","title":"Files"},"total_size_bytes":{"type":"integer","title":"Total Size Bytes"},"file_count":{"type":"integer","title":"File Count"},"quota":{"$ref":"#/components/schemas/FilesQuota"}},"type":"object","required":["files","total_size_bytes","file_count","quota"],"title":"FileListResponse"},"FilesQuota":{"properties":{"max_bytes":{"type":"integer","title":"Max Bytes"},"max_files":{"type":"integer","title":"Max Files"},"max_file_bytes":{"type":"integer","title":"Max File Bytes"}},"type":"object","required":["max_bytes","max_files","max_file_bytes"],"title":"FilesQuota"},"FoundingChecklistItem":{"properties":{"step":{"type":"string","title":"Step"},"status":{"type":"string","title":"Status"}},"type":"object","required":["step","status"],"title":"FoundingChecklistItem"},"FoundingCurrentResponse":{"properties":{"founding":{"anyOf":[{"$ref":"#/components/schemas/FoundingResponse"},{"type":"null"}]},"messages":{"items":{"$ref":"#/components/schemas/FoundingMessageResponse"},"type":"array","title":"Messages","default":[]},"documents":{"items":{"$ref":"#/components/schemas/FoundingDocumentResponse"},"type":"array","title":"Documents","default":[]},"checklist":{"items":{"$ref":"#/components/schemas/FoundingChecklistItem"},"type":"array","title":"Checklist","default":[]},"segment_running":{"type":"boolean","title":"Segment Running","default":false},"claim_age_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Claim Age Seconds"},"site_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Domain"}},"type":"object","title":"FoundingCurrentResponse","description":"The whole page state in one call: the row, the transcript, liveness.\n\n``segment_running`` is what the frontend watchdog polls before it fires a\nsilent re-kick: a stale claim after ~15s of stream silence means the segment\ndied (deploy, scale-down) and nobody is coming back to it."},"FoundingDocumentResponse":{"properties":{"id":{"type":"string","title":"Id"},"target":{"type":"string","title":"Target"},"version":{"type":"integer","title":"Version"},"rendered_markdown":{"type":"string","title":"Rendered Markdown"}},"type":"object","required":["id","target","version","rendered_markdown"],"title":"FoundingDocumentResponse","description":"A document version. ``fields`` and the markdown are included so the\nfounder can read their constitution after founding without a second call."},"FoundingGatePayload":{"properties":{"kind":{"type":"string","title":"Kind"},"message":{"type":"string","title":"Message"},"credits":{"type":"number","title":"Credits"},"needed":{"type":"number","title":"Needed"},"has_plan":{"type":"boolean","title":"Has Plan"},"plan_past_due":{"type":"boolean","title":"Plan Past Due","default":false},"refill_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refill At"},"auto_topup_enabled":{"type":"boolean","title":"Auto Topup Enabled","default":false}},"type":"object","required":["kind","message","credits","needed","has_plan"],"title":"FoundingGatePayload","description":"The standing-to-found card, without the 402 ``error`` envelope.\n\nSame fields the FOUND press returns inside ``FoundingGateError``. ``None``\non the upgrade GET means standing is present (the sheet keeps Switch to v3)."},"FoundingMessageResponse":{"properties":{"seq":{"type":"integer","title":"Seq"},"content":{"additionalProperties":true,"type":"object","title":"Content"}},"type":"object","required":["seq","content"],"title":"FoundingMessageResponse","description":"One transcript row, exactly as stored. ``seq`` is also the stream cursor."},"FoundingResponse":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"idea":{"type":"string","title":"Idea"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"handle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handle"},"company_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"interrupt_requested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Interrupt Requested At"},"kind":{"type":"string","title":"Kind","default":"create"}},"type":"object","required":["id","status","idea","name","handle","company_id","session_id","error"],"title":"FoundingResponse"},"GenerateNameResponse":{"properties":{"name":{"type":"string","title":"Name"},"handle":{"type":"string","title":"Handle"}},"type":"object","required":["name","handle"],"title":"GenerateNameResponse","description":"A generated name + verified-available handle. Does not lock either."},"GitHubRepoResponse":{"properties":{"repo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repo Url"},"repo_full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repo Full Name"},"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"GitHubRepoResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HandleCheckResponse":{"properties":{"handle":{"type":"string","title":"Handle"},"status":{"type":"string","title":"Status"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"suggestion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggestion"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["handle","status"],"title":"HandleCheckResponse","description":"``available`` | ``taken`` | ``reserved`` | ``invalid``, plus a suggestion.\n\n``reserved`` is a handle another founder is mid-interview on. Distinct from\n``taken`` because it is temporary — that interview can be abandoned — and the\ncopy should not imply the name is gone forever."},"IncidentSummary":{"properties":{"title":{"type":"string","title":"Title"},"status":{"type":"string","title":"Status"},"area":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Area"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"}},"type":"object","required":["title","status"],"title":"IncidentSummary"},"InternalCreateTaskRequest":{"properties":{"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"priority":{"type":"string","title":"Priority","default":"normal"},"created_by":{"type":"string","title":"Created By","default":"ceo_agent"},"runner":{"type":"string","title":"Runner","default":"worker_codex"}},"type":"object","required":["title"],"title":"InternalCreateTaskRequest"},"InterruptFoundingResponse":{"properties":{"founding_id":{"type":"string","title":"Founding Id"},"interrupt_requested_at":{"type":"string","format":"date-time","title":"Interrupt Requested At"}},"type":"object","required":["founding_id","interrupt_requested_at"],"title":"InterruptFoundingResponse","description":"The stop's receipt (reconciliation-2 spec §6), mirroring\n:class:`InterruptSessionResponse`: the stamp is idempotent, so a second\npress returns the first press's timestamp unchanged."},"InterruptSessionResponse":{"properties":{"turn_id":{"type":"string","title":"Turn Id"},"interrupt_requested_at":{"type":"string","format":"date-time","title":"Interrupt Requested At"}},"type":"object","required":["turn_id","interrupt_requested_at"],"title":"InterruptSessionResponse"},"IsOwnerRequest":{"properties":{"sub":{"type":"string","maxLength":64,"title":"Sub"}},"type":"object","required":["sub"],"title":"IsOwnerRequest","description":"D-47: POST body (POST so ``sub`` never reaches an access log)."},"IsOwnerResponse":{"properties":{"is_app_owner":{"type":"boolean","title":"Is App Owner"}},"type":"object","required":["is_app_owner"],"title":"IsOwnerResponse"},"KnownIncidentsResponse":{"properties":{"found":{"type":"boolean","title":"Found","default":true},"active_count":{"type":"integer","title":"Active Count","default":0},"incidents":{"items":{"$ref":"#/components/schemas/IncidentSummary"},"type":"array","title":"Incidents"}},"type":"object","title":"KnownIncidentsResponse"},"LightSurvivorRequest":{"properties":{"company_id":{"type":"string","format":"uuid","title":"Company Id"}},"type":"object","required":["company_id"],"title":"LightSurvivorRequest"},"LightSurvivorResponse":{"properties":{"kept_company_id":{"type":"string","title":"Kept Company Id"},"paused_company_ids":{"items":{"type":"string"},"type":"array","title":"Paused Company Ids"},"failed_company_ids":{"items":{"type":"string"},"type":"array","title":"Failed Company Ids"}},"type":"object","required":["kept_company_id","paused_company_ids","failed_company_ids"],"title":"LightSurvivorResponse"},"MargotActionRequest":{"properties":{"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id","description":"The verified Intercom contact external_id (= NanoCorp user id)."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"The contact's email. Used as a fallback identity and a cross-check."},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company","description":"Optional company name/handle hint, resolved against the caller's own companies."},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Optional row limit for list actions."}},"type":"object","title":"MargotActionRequest","description":"Common request body for every Margot action.\n\nIdentity comes from the Intercom contact, which is identity-verified at\nMessenger boot (HMAC over `external_id` = our `user.id`). The backend trusts\n`external_id` (or `email` as a fallback) and resolves the conglomerate\nserver-side — it never trusts a company/conglomerate id from the body."},"MarkMilestonesSeenResponse":{"properties":{"marked":{"type":"integer","title":"Marked"}},"type":"object","required":["marked"],"title":"MarkMilestonesSeenResponse","description":"Result of marking milestones seen."},"MeResponse":{"properties":{"subject_type":{"type":"string","title":"Subject Type"},"conglomerate_id":{"type":"string","title":"Conglomerate Id"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"source":{"type":"string","title":"Source"},"token_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Kind"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"alpha_access":{"type":"boolean","title":"Alpha Access","default":false},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"profile_picture_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Picture Url"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"x_onboarding_shown":{"type":"boolean","title":"X Onboarding Shown","default":false},"x_handle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X Handle"},"x_verification_code":{"type":"string","title":"X Verification Code","default":""},"x_verified_company_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X Verified Company Id"},"company_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Id"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"company_handle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Handle"}},"type":"object","required":["subject_type","conglomerate_id","scopes","source"],"title":"MeResponse","description":"Principal-aware identity for ``GET /auth/me`` (Spec 2, D-17).\n\nAnswers for both user credentials (web JWT, ``nano_u_v1_`` session/PAT) and\ncompany credentials (``nano_c_v1_``). The user variant keeps every field the\nfrontend reads (it only ever sees this variant); the company variant fills\nthe ``company_*`` fields and leaves the user fields null."},"MessageListResponse":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/ChatMessageResponse"},"type":"array","title":"Messages"}},"type":"object","required":["messages"],"title":"MessageListResponse"},"MetaAdPreviewResponse":{"properties":{"html":{"type":"string","title":"Html"},"width":{"type":"integer","title":"Width"},"height":{"type":"integer","title":"Height"}},"type":"object","required":["html","width","height"],"title":"MetaAdPreviewResponse"},"MetaAdsPanelResponse":{"properties":{"eligible":{"type":"boolean","title":"Eligible"},"ads_billing_acknowledged":{"type":"boolean","title":"Ads Billing Acknowledged"},"has_campaign":{"type":"boolean","title":"Has Campaign"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"creative_status":{"type":"string","title":"Creative Status"},"daily_cap_usd":{"type":"number","title":"Daily Cap Usd"},"min_daily_cap_usd":{"type":"number","title":"Min Daily Cap Usd"},"max_daily_cap_usd":{"type":"number","title":"Max Daily Cap Usd"},"primary_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Text"},"headline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Headline"},"cta_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cta Type"},"destination_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination Url"},"target_countries":{"items":{"type":"string"},"type":"array","title":"Target Countries"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"},"stats":{"$ref":"#/components/schemas/MetaAdsStats"},"charged_today_usd":{"type":"number","title":"Charged Today Usd"},"prepaid_buffer_usd":{"type":"number","title":"Prepaid Buffer Usd"},"insufficient_credits":{"type":"boolean","title":"Insufficient Credits"},"not_delivering":{"type":"boolean","title":"Not Delivering"},"generation_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generation Error"},"launch_queue_ahead":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Launch Queue Ahead"},"ad_rejected":{"type":"boolean","title":"Ad Rejected"},"policy_blocked_vertical":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Blocked Vertical"}},"type":"object","required":["eligible","ads_billing_acknowledged","has_campaign","status","creative_status","daily_cap_usd","min_daily_cap_usd","max_daily_cap_usd","primary_text","headline","cta_type","destination_url","target_countries","thumbnail_url","stats","charged_today_usd","prepaid_buffer_usd","insufficient_credits","not_delivering","generation_error","launch_queue_ahead","ad_rejected","policy_blocked_vertical"],"title":"MetaAdsPanelResponse"},"MetaAdsStats":{"properties":{"ctr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ctr"},"cpm":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cpm"},"cpc":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cpc"},"clicks":{"type":"integer","title":"Clicks"},"impressions":{"type":"integer","title":"Impressions"},"spend_7d_usd":{"type":"number","title":"Spend 7D Usd"},"spend_lifetime_usd":{"type":"number","title":"Spend Lifetime Usd"}},"type":"object","required":["ctr","cpm","cpc","clicks","impressions","spend_7d_usd","spend_lifetime_usd"],"title":"MetaAdsStats"},"MilestoneResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"milestone_key":{"type":"string","title":"Milestone Key"},"category":{"type":"string","title":"Category"},"tier":{"type":"string","title":"Tier"},"value":{"additionalProperties":true,"type":"object","title":"Value"},"achieved_at":{"type":"string","format":"date-time","title":"Achieved At"},"seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Seen At"},"source":{"type":"string","title":"Source"}},"type":"object","required":["id","company_id","milestone_key","category","tier","value","achieved_at","source"],"title":"MilestoneResponse","description":"One achieved milestone (a trophy on the shelf)."},"MilestonesResponse":{"properties":{"achieved":{"items":{"$ref":"#/components/schemas/MilestoneResponse"},"type":"array","title":"Achieved"},"unseen_marquee":{"items":{"$ref":"#/components/schemas/MilestoneResponse"},"type":"array","title":"Unseen Marquee"},"next":{"anyOf":[{"$ref":"#/components/schemas/NextMilestoneResponse"},{"type":"null"}]}},"type":"object","required":["achieved","unseen_marquee"],"title":"MilestonesResponse","description":"The full milestones payload for a company's dashboard."},"NameFoundingRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"handle":{"type":"string","maxLength":15,"minLength":1,"title":"Handle"}},"type":"object","required":["name","handle"],"title":"NameFoundingRequest"},"NextMilestoneResponse":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"target_cents":{"type":"integer","title":"Target Cents"},"current_cents":{"type":"integer","title":"Current Cents"},"achieved":{"type":"boolean","title":"Achieved"}},"type":"object","required":["key","label","target_cents","current_cents","achieved"],"title":"NextMilestoneResponse","description":"The forward-looking teaser shown before the milestone is achieved."},"OnboardingStatusResponse":{"properties":{"completed_steps":{"items":{"type":"string"},"type":"array","title":"Completed Steps"}},"type":"object","required":["completed_steps"],"title":"OnboardingStatusResponse"},"OnboardingUrlResponse":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"OnboardingUrlResponse"},"PostSessionMessageRequest":{"properties":{"message":{"type":"string","maxLength":50000,"minLength":1,"title":"Message"},"prompt_source":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Prompt Source"},"queued":{"type":"boolean","title":"Queued","default":false}},"type":"object","required":["message"],"title":"PostSessionMessageRequest"},"PrefixDeleteResponse":{"properties":{"deleted":{"type":"integer","title":"Deleted"}},"type":"object","required":["deleted"],"title":"PrefixDeleteResponse"},"ProductAnalyticsResponse":{"properties":{"found":{"type":"boolean","title":"Found","default":true},"company":{"anyOf":[{"$ref":"#/components/schemas/CompanySummary"},{"type":"null"}]},"since":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"},"until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Until"},"total_events":{"type":"integer","title":"Total Events","default":0},"pageviews":{"type":"integer","title":"Pageviews","default":0},"unique_visitors":{"type":"integer","title":"Unique Visitors","default":0},"unique_sessions":{"type":"integer","title":"Unique Sessions","default":0},"exceptions":{"type":"integer","title":"Exceptions","default":0}},"type":"object","title":"ProductAnalyticsResponse"},"ProductSellingPauseResponse":{"properties":{"company_id":{"type":"string","title":"Company Id"},"product_id":{"type":"string","title":"Product Id"},"paused":{"type":"boolean","title":"Paused"}},"type":"object","required":["company_id","product_id","paused"],"title":"ProductSellingPauseResponse","description":"New per-product selling-pause state after a toggle."},"ProvisionCompanyRequest":{"properties":{"seed_repo":{"type":"boolean","title":"Seed Repo","default":true}},"type":"object","title":"ProvisionCompanyRequest","description":"Body for the idempotent re-provision trigger."},"ProvisionTriggerResponse":{"properties":{"company_id":{"type":"string","title":"Company Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["company_id","status"],"title":"ProvisionTriggerResponse"},"RaiseDailyCapRequest":{"properties":{"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id","description":"The verified Intercom contact external_id (= NanoCorp user id)."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"The contact's email. Used as a fallback identity and a cross-check."},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company","description":"Optional company name/handle hint, resolved against the caller's own companies."},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Optional row limit for list actions."},"target_daily_credits":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Target Daily Credits","description":"Desired new daily credit cap. Omit to bump by a default step. Clamped to the Margot ceiling; never lowers the cap or sets it unlimited."}},"type":"object","title":"RaiseDailyCapRequest","description":"Raise the caller's conglomerate-wide daily credit cap — Margot's only WRITE action.\n\n`target_daily_credits` is the value the user asked for (Fin extracts it from the\nmessage). Omitted/None → the endpoint bumps the cap by a default step. The\nendpoint refuses to *lower* the cap, never sets it to 0 (unlimited), and clamps\nto a Margot ceiling — so the worst a confused or hostile message can do is push\nthe 24h rate limit up to that ceiling (real spend is still bounded by the credit\nbalance)."},"RaiseDailyCapResponse":{"properties":{"found":{"type":"boolean","title":"Found","default":true},"changed":{"type":"boolean","title":"Changed","default":false},"clamped":{"type":"boolean","title":"Clamped","default":false},"previous_max_daily_credits":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Previous Max Daily Credits"},"max_daily_credits":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Daily Credits"},"ceiling":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ceiling"},"credit_balance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credit Balance"},"credits_used_today":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credits Used Today"}},"type":"object","title":"RaiseDailyCapResponse"},"RaiseDailyCapServiceRequest":{"properties":{"conglomerate_id":{"type":"string","format":"uuid","title":"Conglomerate Id","description":"The conglomerate whose daily credit cap to raise."},"target_daily_credits":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Target Daily Credits","description":"Desired new daily credit cap. Omit to bump by a default step. Clamped to the support ceiling; never lowers the cap or sets it unlimited."}},"type":"object","required":["conglomerate_id"],"title":"RaiseDailyCapServiceRequest","description":"Ask the main backend to raise one conglomerate's 24h credit cap.\n\n``conglomerate_id`` is supplied by the caller, which has ALREADY resolved and\nverified the customer's scope on its side (it owns the identity-verified\ncontact → conglomerate mapping). This endpoint trusts the id only as far as\nloading that row: what bounds the blast radius is not the id check but the\naction itself — raise-only, never unlimited, clamped to\n``core.billing.SUPPORT_DAILY_CAP_CEILING``."},"RaiseDailyCapServiceResponse":{"properties":{"changed":{"type":"boolean","title":"Changed"},"clamped":{"type":"boolean","title":"Clamped"},"previous_max_daily_credits":{"type":"number","title":"Previous Max Daily Credits"},"max_daily_credits":{"type":"number","title":"Max Daily Credits"},"ceiling":{"type":"number","title":"Ceiling"}},"type":"object","required":["changed","clamped","previous_max_daily_credits","max_daily_credits","ceiling"],"title":"RaiseDailyCapServiceResponse","description":"The outcome of a raise attempt — enough for the caller to explain itself.\n\n``changed=False`` covers every no-op (already at/above the request, already at\nthe ceiling, or already unlimited); ``clamped=True`` means the request was\nabove the ceiling, which is the caller's cue to offer a human."},"ReferralStatsResponse":{"properties":{"referral_link":{"type":"string","title":"Referral Link"},"total_referrals":{"type":"integer","title":"Total Referrals"},"total_earned_credits":{"type":"integer","title":"Total Earned Credits"}},"type":"object","required":["referral_link","total_referrals","total_earned_credits"],"title":"ReferralStatsResponse"},"RefundResponse":{"properties":{"transaction":{"$ref":"#/components/schemas/TransactionResponse"},"already_refunded":{"type":"boolean","title":"Already Refunded","default":false}},"type":"object","required":["transaction"],"title":"RefundResponse","description":"Result of a refund action: the sale, now flagged refunded.\n\n``already_refunded`` is true when the sale was already refunded (idempotent no-op) —\nthe Stripe refund was not issued a second time."},"RunListResponse":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/RunResponse"},"type":"array","title":"Runs"}},"type":"object","required":["runs"],"title":"RunListResponse"},"RunMessageListResponse":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/RunMessageResponse"},"type":"array","title":"Messages"}},"type":"object","required":["messages"],"title":"RunMessageListResponse"},"RunMessageResponse":{"properties":{"id":{"type":"string","title":"Id"},"run_id":{"type":"string","title":"Run Id"},"message_type":{"$ref":"#/components/schemas/RunMessageType"},"content":{"type":"string","title":"Content"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"seq":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seq"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","run_id","message_type","content","created_at"],"title":"RunMessageResponse"},"RunMessageType":{"type":"string","enum":["log","assistant","tool_use","tool_result","error","system","user"],"title":"RunMessageType"},"RunResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"run_type":{"anyOf":[{"$ref":"#/components/schemas/RunType"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/RunStatus"},"trigger":{"$ref":"#/components/schemas/RunTrigger"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"token_count_input":{"type":"integer","title":"Token Count Input","default":0},"token_count_output":{"type":"integer","title":"Token Count Output","default":0},"cost_usd":{"type":"number","title":"Cost Usd","default":0.0},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","company_id","status","trigger","created_at","updated_at"],"title":"RunResponse"},"RunStatus":{"type":"string","enum":["pending","running","completed","failed","interrupted"],"title":"RunStatus"},"RunSummary":{"properties":{"run_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Type"},"status":{"type":"string","title":"Status"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["status"],"title":"RunSummary"},"RunTrigger":{"type":"string","enum":["manual","ceo_agent","cron","founding"],"title":"RunTrigger"},"RunType":{"type":"string","enum":["ceo","worker","reporter","worker_nextjs","build_session","session_turn"],"title":"RunType"},"RunwayProjectionResponse":{"properties":{"credit_balance":{"type":"number","title":"Credit Balance"},"credit_floor":{"type":"number","title":"Credit Floor"},"max_daily_tasks":{"type":"integer","title":"Max Daily Tasks"},"max_daily_credits":{"type":"number","title":"Max Daily Credits"},"burn_per_day":{"type":"number","title":"Burn Per Day"},"worker_runs_per_day":{"type":"number","title":"Worker Runs Per Day"},"cost_per_task":{"type":"number","title":"Cost Per Task"},"cost_per_task_is_estimate":{"type":"boolean","title":"Cost Per Task Is Estimate"},"runway_weeks":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Runway Weeks"},"days_until_grant":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Days Until Grant"},"worker_runs_24h":{"type":"integer","title":"Worker Runs 24H"},"cong_credits_24h":{"type":"number","title":"Cong Credits 24H"},"daily_burn":{"items":{"$ref":"#/components/schemas/DayValueResponse"},"type":"array","title":"Daily Burn"},"daily_worker_runs":{"items":{"$ref":"#/components/schemas/DayValueResponse"},"type":"array","title":"Daily Worker Runs"},"primary_company":{"type":"boolean","title":"Primary Company"}},"type":"object","required":["credit_balance","credit_floor","max_daily_tasks","max_daily_credits","burn_per_day","worker_runs_per_day","cost_per_task","cost_per_task_is_estimate","runway_weeks","days_until_grant","worker_runs_24h","cong_credits_24h","daily_burn","daily_worker_runs","primary_company"],"title":"RunwayProjectionResponse","description":"Inputs for the frontend's mode-aware runway projection (all credits)."},"SecretResponse":{"properties":{"key":{"type":"string","title":"Key"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["key"],"title":"SecretResponse"},"SellingPauseRequest":{"properties":{"paused":{"type":"boolean","title":"Paused"},"source":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Source"}},"type":"object","required":["paused"],"title":"SellingPauseRequest","description":"Owner-intent 'Pause selling' toggle payload (master or per-product)."},"SellingPauseResponse":{"properties":{"company_id":{"type":"string","title":"Company Id"},"paused":{"type":"boolean","title":"Paused"}},"type":"object","required":["company_id","paused"],"title":"SellingPauseResponse","description":"New master 'Pause selling' state after a toggle."},"SendEmailRequest":{"properties":{"to":{"type":"string","format":"email","title":"To"},"subject":{"type":"string","maxLength":998,"minLength":1,"title":"Subject"},"body":{"type":"string","maxLength":100000,"minLength":1,"title":"Body"},"in_reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"In Reply To"}},"type":"object","required":["to","subject","body"],"title":"SendEmailRequest"},"SessionDetailResponse":{"properties":{"session":{"$ref":"#/components/schemas/SessionResponse"},"turns":{"items":{"$ref":"#/components/schemas/SessionTurnResponse"},"type":"array","title":"Turns"},"messages":{"items":{"$ref":"#/components/schemas/RunMessageResponse"},"type":"array","title":"Messages"},"active_turn_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Turn Id"}},"type":"object","required":["session","turns","messages"],"title":"SessionDetailResponse"},"SessionListItemResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"trigger":{"$ref":"#/components/schemas/SessionTrigger"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"has_active_turn":{"type":"boolean","title":"Has Active Turn","default":false}},"type":"object","required":["id","company_id","trigger","created_at","updated_at"],"title":"SessionListItemResponse","description":"List rows only. ``has_active_turn`` is turn-lock ground truth\n(remediation RS-4) — defaulted so the shared ``SessionResponse`` surfaces\n(detail envelope, turn-created) stay untouched."},"SessionListResponse":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/SessionListItemResponse"},"type":"array","title":"Sessions"}},"type":"object","required":["sessions"],"title":"SessionListResponse"},"SessionResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"trigger":{"$ref":"#/components/schemas/SessionTrigger"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","company_id","trigger","created_at","updated_at"],"title":"SessionResponse"},"SessionTrigger":{"type":"string","enum":["user","schedule"],"title":"SessionTrigger"},"SessionTurnCreatedResponse":{"properties":{"session":{"$ref":"#/components/schemas/SessionResponse"},"turn":{"$ref":"#/components/schemas/SessionTurnResponse"}},"type":"object","required":["session","turn"],"title":"SessionTurnCreatedResponse"},"SessionTurnResponse":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"status":{"$ref":"#/components/schemas/RunStatus"},"trigger":{"$ref":"#/components/schemas/RunTrigger"},"interrupt_requested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Interrupt Requested At"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","status","trigger","created_at"],"title":"SessionTurnResponse"},"SetDailyCapRequest":{"properties":{"daily_cap_usd":{"type":"number","title":"Daily Cap Usd"}},"type":"object","required":["daily_cap_usd"],"title":"SetDailyCapRequest"},"SetSitePausedRequest":{"properties":{"paused":{"type":"boolean","title":"Paused"},"source":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Source"}},"type":"object","required":["paused"],"title":"SetSitePausedRequest"},"SetVercelEnvVarsRequest":{"properties":{"env_vars":{"items":{"$ref":"#/components/schemas/VercelEnvVarItem"},"type":"array","maxItems":50,"minItems":1,"title":"Env Vars"}},"type":"object","required":["env_vars"],"title":"SetVercelEnvVarsRequest"},"SitePauseStateResponse":{"properties":{"site_paused":{"type":"boolean","title":"Site Paused"},"custom_domain_parked":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Custom Domain Parked"},"preview_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview Url"},"custom_domain_parking_available":{"type":"boolean","title":"Custom Domain Parking Available","default":true}},"type":"object","required":["site_paused"],"title":"SitePauseStateResponse"},"StartFoundingRequest":{"properties":{"idea":{"type":"string","maxLength":20000,"minLength":10,"title":"Idea"}},"type":"object","required":["idea"],"title":"StartFoundingRequest"},"StripePaymentLinkResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"stripe_payment_link_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Payment Link Id"},"url":{"type":"string","title":"Url"},"test_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Test Url"},"active":{"type":"boolean","title":"Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","company_id","stripe_payment_link_id","url","active","created_at","updated_at"],"title":"StripePaymentLinkResponse"},"StripeProductListResponse":{"properties":{"products":{"items":{"$ref":"#/components/schemas/StripeProductResponse"},"type":"array","title":"Products"}},"type":"object","required":["products"],"title":"StripeProductListResponse"},"StripeProductResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"stripe_product_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Product Id"},"stripe_price_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Price Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"price_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Cents"},"currency":{"type":"string","title":"Currency"},"active":{"type":"boolean","title":"Active"},"checkout_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkout Url"},"test_checkout_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Test Checkout Url"},"paused":{"type":"boolean","title":"Paused","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","company_id","name","currency","active","created_at","updated_at"],"title":"StripeProductResponse"},"StripeRevenueResponse":{"properties":{"total_cents":{"type":"integer","title":"Total Cents"},"payment_count":{"type":"integer","title":"Payment Count"},"total_dollars":{"type":"number","title":"Total Dollars"}},"type":"object","required":["total_cents","payment_count","total_dollars"],"title":"StripeRevenueResponse"},"StripeWebhookDeliveryListResponse":{"properties":{"deliveries":{"items":{"$ref":"#/components/schemas/StripeWebhookDeliveryResponse"},"type":"array","title":"Deliveries"}},"type":"object","required":["deliveries"],"title":"StripeWebhookDeliveryListResponse"},"StripeWebhookDeliveryResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"webhook_url":{"type":"string","title":"Webhook Url"},"event_type":{"type":"string","title":"Event Type"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Code"},"success":{"type":"boolean","title":"Success"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"attempted_at":{"type":"string","format":"date-time","title":"Attempted At"}},"type":"object","required":["id","company_id","webhook_url","event_type","payload","success","attempted_at"],"title":"StripeWebhookDeliveryResponse"},"SubscriptionInfoResponse":{"properties":{"plan_tier":{"type":"string","title":"Plan Tier"},"credit_balance":{"type":"number","title":"Credit Balance"},"credits_per_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Per Month"},"current_period_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period Start"},"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"},"pending_downgrade_to":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pending Downgrade To"},"max_daily_credits":{"type":"number","title":"Max Daily Credits"},"credits_used_today":{"type":"number","title":"Credits Used Today"},"auto_topup_enabled":{"type":"boolean","title":"Auto Topup Enabled"},"auto_topup_credits":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Auto Topup Credits"},"auto_topup_disabled_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auto Topup Disabled Reason"},"auto_topup_threshold":{"type":"number","title":"Auto Topup Threshold"},"notice":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionNoticeResponse"},{"type":"null"}]},"plan_expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Expires At"},"light_available":{"type":"boolean","title":"Light Available","default":false},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","default":false},"dormant_demand_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dormant Demand Count"}},"type":"object","required":["plan_tier","credit_balance","credits_per_month","current_period_start","current_period_end","subscription_status","max_daily_credits","credits_used_today","auto_topup_enabled","auto_topup_credits","auto_topup_disabled_reason","auto_topup_threshold"],"title":"SubscriptionInfoResponse"},"SubscriptionNoticeResponse":{"properties":{"kind":{"type":"string","enum":["credits_low","credits_critical","founder_plan"],"title":"Kind"},"credits":{"type":"number","title":"Credits"},"has_plan":{"type":"boolean","title":"Has Plan"},"refill_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refill At"},"auto_topup_armed":{"type":"boolean","title":"Auto Topup Armed"},"episode_anchor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Episode Anchor"},"ship_product_floor":{"type":"number","title":"Ship Product Floor"}},"type":"object","required":["kind","credits","has_plan","refill_at","auto_topup_armed","episode_anchor","ship_product_floor"],"title":"SubscriptionNoticeResponse","description":"The ONE money notice the chat rail may show (spec CREDIT_NOTICES §6.3).\n\nPicked server-side (use_cases/credits/notices.py) so the thresholds are\nnever re-derived in TS. ``episode_anchor`` is the client's dismissal key:\nthe last time credits were added, so a dismissed notice re-arms exactly\nwhen the balance was refilled and drained again."},"TaskCreatedBy":{"type":"string","enum":["user","ceo_agent","worker_agent","agent"],"title":"TaskCreatedBy"},"TaskListResponse":{"properties":{"tasks":{"items":{"$ref":"#/components/schemas/TaskResponse"},"type":"array","title":"Tasks"}},"type":"object","required":["tasks"],"title":"TaskListResponse"},"TaskPriority":{"type":"string","enum":["critical","high","normal","low"],"title":"TaskPriority"},"TaskResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"$ref":"#/components/schemas/TaskStatus"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"created_by":{"$ref":"#/components/schemas/TaskCreatedBy"},"runner":{"type":"string","title":"Runner","default":"worker"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"},"result_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result Summary"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"retry_count":{"type":"integer","title":"Retry Count"},"max_retries":{"type":"integer","title":"Max Retries"},"parent_task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Task Id"},"cycle_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cycle Id"},"due_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due At"},"recurrence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recurrence"},"effective_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective Status"},"due_annotation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Annotation"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","company_id","title","status","priority","created_by","retry_count","max_retries","created_at","updated_at"],"title":"TaskResponse"},"TaskStatus":{"type":"string","enum":["pending","dispatched","in_progress","completed","failed","moderated"],"title":"TaskStatus"},"TokenResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"kind":{"type":"string","title":"Kind"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","key_prefix","kind","created_at"],"title":"TokenResponse"},"ToolCallInfo":{"properties":{"name":{"type":"string","title":"Name"},"input":{"additionalProperties":true,"type":"object","title":"Input"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"string"},{"type":"null"}],"title":"Result"}},"type":"object","required":["name","input"],"title":"ToolCallInfo"},"ToolDefinition":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema"}},"type":"object","required":["name","description","input_schema"],"title":"ToolDefinition"},"ToolListResponse":{"properties":{"tools":{"items":{"$ref":"#/components/schemas/ToolDefinition"},"type":"array","title":"Tools"}},"type":"object","required":["tools"],"title":"ToolListResponse"},"TransactionListResponse":{"properties":{"transactions":{"items":{"$ref":"#/components/schemas/TransactionResponse"},"type":"array","title":"Transactions"}},"type":"object","required":["transactions"],"title":"TransactionListResponse"},"TransactionResponse":{"properties":{"id":{"type":"string","title":"Id"},"customer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Email"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"product_names":{"items":{"type":"string"},"type":"array","title":"Product Names","default":[]},"presentment_amount_cents":{"type":"integer","title":"Presentment Amount Cents"},"presentment_currency":{"type":"string","title":"Presentment Currency"},"usd_amount_cents":{"type":"integer","title":"Usd Amount Cents"},"stripe_payment_intent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Payment Intent Id"},"refunded":{"type":"boolean","title":"Refunded","default":false},"refundable":{"type":"boolean","title":"Refundable","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","presentment_amount_cents","presentment_currency","usd_amount_cents","created_at"],"title":"TransactionResponse","description":"One customer sale (an EARNING ledger row) for the Transactions panel.\n\nAmounts: ``presentment_*`` is what the customer actually paid in their card\ncurrency (shown as the primary figure); ``usd_amount_cents`` is the settled USD\nNanoCorp credited (shown secondary). ``product_names`` come from the Stripe\ncheckout line items (captured at sale time, else resolved+cached on first view).\n``refunded`` is derived from a matching customer-refund ledger row; ``refundable``\nis true when the sale can still be refunded (not yet refunded, PI known)."},"TranscriptAppendRequest":{"properties":{"subpath":{"type":"string","maxLength":512,"title":"Subpath","default":""},"entries":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":2000,"minItems":1,"title":"Entries"}},"type":"object","required":["entries"],"title":"TranscriptAppendRequest"},"TranscriptAppendResponse":{"properties":{"inserted":{"type":"integer","title":"Inserted"}},"type":"object","required":["inserted"],"title":"TranscriptAppendResponse"},"TranscriptLoadResponse":{"properties":{"entries":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Entries"}},"type":"object","title":"TranscriptLoadResponse"},"TranscriptSubpathsResponse":{"properties":{"subpaths":{"items":{"type":"string"},"type":"array","title":"Subpaths"}},"type":"object","required":["subpaths"],"title":"TranscriptSubpathsResponse"},"TrendPoint":{"properties":{"bucket":{"type":"string","format":"date-time","title":"Bucket"},"pageviews":{"type":"integer","title":"Pageviews"}},"type":"object","required":["bucket","pageviews"],"title":"TrendPoint","description":"One zero-filled bucket on the trend line.\n\n`bucket` is a naive-UTC ISO-8601 timestamp aligned to either the start of\na UTC day or a UTC hour, depending on the requested range. Frontend\nreformats to local TZ for axis labels."},"TriggerRunResponse":{"properties":{"run":{"$ref":"#/components/schemas/RunResponse"},"message":{"type":"string","title":"Message","default":"Run triggered"}},"type":"object","required":["run"],"title":"TriggerRunResponse"},"TurnContextResponse":{"properties":{"session_id":{"type":"string","title":"Session Id"},"company_id":{"type":"string","title":"Company Id"},"trigger":{"type":"string","title":"Trigger"},"turn_trigger":{"type":"string","title":"Turn Trigger"},"sdk_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sdk Session Id"},"system_prompt":{"type":"string","title":"System Prompt"},"user_message":{"type":"string","title":"User Message"},"reset_banner":{"type":"boolean","title":"Reset Banner","default":false},"model":{"type":"string","title":"Model"}},"type":"object","required":["session_id","company_id","trigger","turn_trigger","system_prompt","user_message","model"],"title":"TurnContextResponse","description":"Everything the sandbox entrypoint needs to run one turn."},"TurnControlResponse":{"properties":{"interrupt":{"type":"boolean","title":"Interrupt","default":false}},"type":"object","title":"TurnControlResponse","description":"Alpha payload: {interrupt}. One route shaped to carry later signals\n(e.g. next_message for warm sandbox reuse) without a new surface."},"TurnPatchRequest":{"properties":{"status":{"anyOf":[{"type":"string","enum":["completed","failed","interrupted"]},{"type":"null"}],"title":"Status"},"error_message":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Error Message"},"sdk_session_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Sdk Session Id"},"clear_sdk_session_id":{"type":"boolean","title":"Clear Sdk Session Id","default":false}},"type":"object","title":"TurnPatchRequest"},"UpdateCompanyRequest":{"properties":{"one_liner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"One Liner"},"mission":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mission"},"status":{"anyOf":[{"$ref":"#/components/schemas/CompanyStatus"},{"type":"null"}]},"cycle_interval_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cycle Interval Seconds"},"max_daily_tasks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Daily Tasks"},"custom_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Domain"},"outbound_email_paused":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Outbound Email Paused"},"outbound_prospect_search_paused":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Outbound Prospect Search Paused"},"source":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Source"}},"type":"object","title":"UpdateCompanyRequest"},"UpdateConglomerateRequest":{"properties":{"max_daily_credits":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Daily Credits"}},"type":"object","title":"UpdateConglomerateRequest"},"UpdateRunStatsRequest":{"properties":{"token_count_input":{"type":"integer","minimum":0.0,"title":"Token Count Input","default":0},"token_count_output":{"type":"integer","minimum":0.0,"title":"Token Count Output","default":0},"cost_usd":{"type":"number","minimum":0.0,"title":"Cost Usd","default":0.0},"cache_read_input_tokens":{"type":"integer","minimum":0.0,"title":"Cache Read Input Tokens","default":0},"cache_creation_input_tokens":{"type":"integer","minimum":0.0,"title":"Cache Creation Input Tokens","default":0}},"type":"object","title":"UpdateRunStatsRequest"},"UpdateSecretRequest":{"properties":{"value":{"anyOf":[{"type":"string","maxLength":32768,"minLength":1},{"type":"null"}],"title":"Value"},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Description"}},"type":"object","title":"UpdateSecretRequest"},"UpdateSubscriptionRequest":{"properties":{"credits":{"type":"integer","title":"Credits"}},"type":"object","required":["credits"],"title":"UpdateSubscriptionRequest"},"UpdateSubscriptionResponse":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"UpdateSubscriptionResponse"},"UpdateTaskRequest":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"UpdateTaskRequest"},"UpdateTaskStatusRequest":{"properties":{"status":{"type":"string","title":"Status"},"result_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result Summary"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},"type":"object","required":["status"],"title":"UpdateTaskStatusRequest"},"UpsertDocumentRequest":{"properties":{"title":{"type":"string","maxLength":255,"minLength":1,"title":"Title"},"content":{"type":"string","maxLength":100000,"title":"Content"}},"type":"object","required":["title","content"],"title":"UpsertDocumentRequest"},"V3UpgradeStatusResponse":{"properties":{"founding":{"anyOf":[{"$ref":"#/components/schemas/FoundingResponse"},{"type":"null"}]},"messages":{"items":{"$ref":"#/components/schemas/FoundingMessageResponse"},"type":"array","title":"Messages","default":[]},"documents":{"items":{"$ref":"#/components/schemas/FoundingDocumentResponse"},"type":"array","title":"Documents","default":[]},"checklist":{"items":{"$ref":"#/components/schemas/FoundingChecklistItem"},"type":"array","title":"Checklist","default":[]},"segment_running":{"type":"boolean","title":"Segment Running","default":false},"claim_age_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Claim Age Seconds"},"site_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Domain"},"standing":{"anyOf":[{"$ref":"#/components/schemas/FoundingGatePayload"},{"type":"null"}]},"eligible":{"type":"boolean","title":"Eligible","default":false}},"type":"object","title":"V3UpgradeStatusResponse","description":"Sheet + upgrade-page loader: current-interview fields plus D9 standing."},"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"},"VercelEnvVarItem":{"properties":{"key":{"type":"string","title":"Key"},"value":{"type":"string","title":"Value"}},"type":"object","required":["key","value"],"title":"VercelEnvVarItem"},"VercelEnvVarResponse":{"properties":{"key":{"type":"string","title":"Key"},"target":{"items":{"type":"string"},"type":"array","title":"Target"},"id":{"type":"string","title":"Id"}},"type":"object","required":["key","target","id"],"title":"VercelEnvVarResponse"},"VercelProjectResponse":{"properties":{"project_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Url"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"status":{"type":"string","title":"Status"},"has_deployment":{"type":"boolean","title":"Has Deployment","default":false},"site_paused":{"type":"boolean","title":"Site Paused","default":false},"preview_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview Url"},"custom_domain_parking_available":{"type":"boolean","title":"Custom Domain Parking Available","default":true}},"type":"object","required":["status"],"title":"VercelProjectResponse"},"WithdrawalCreateBody":{"properties":{"amount_cents":{"type":"integer","title":"Amount Cents"}},"type":"object","required":["amount_cents"],"title":"WithdrawalCreateBody"},"WithdrawalListResponse":{"properties":{"open_request":{"anyOf":[{"$ref":"#/components/schemas/WithdrawalRequestView"},{"type":"null"}]},"history":{"items":{"$ref":"#/components/schemas/WithdrawalRequestView"},"type":"array","title":"History"}},"type":"object","required":["open_request","history"],"title":"WithdrawalListResponse"},"WithdrawalRequestView":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"$ref":"#/components/schemas/WithdrawalStatus"},"gross_cents":{"type":"integer","title":"Gross Cents"},"fee_cents":{"type":"integer","title":"Fee Cents"},"net_cents":{"type":"integer","title":"Net Cents"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid At"},"rejection_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rejection Reason"}},"type":"object","required":["id","status","gross_cents","fee_cents","net_cents","created_at","updated_at"],"title":"WithdrawalRequestView","description":"Public projection of a withdrawal request (no admin notes)."},"WithdrawalResponse":{"properties":{"request_id":{"type":"string","format":"uuid","title":"Request Id"},"status":{"$ref":"#/components/schemas/WithdrawalStatus"},"gross_cents":{"type":"integer","title":"Gross Cents"},"fee_cents":{"type":"integer","title":"Fee Cents"},"net_cents":{"type":"integer","title":"Net Cents"},"onboarding_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Onboarding Url"}},"type":"object","required":["request_id","status","gross_cents","fee_cents","net_cents"],"title":"WithdrawalResponse"},"WithdrawalStatus":{"type":"string","enum":["awaiting_onboarding","pending","processing","paid","rejected"],"title":"WithdrawalStatus"},"XVerifyResponse":{"properties":{"verified":{"type":"boolean","title":"Verified"},"x_handle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X Handle"},"tweet_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tweet Id"},"tweet_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tweet Url"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["verified"],"title":"XVerifyResponse"},"core__schemas__conglomerate__CreditLedgerEntry":{"properties":{"id":{"type":"string","title":"Id"},"event_type":{"type":"string","title":"Event Type"},"credits":{"type":"number","title":"Credits"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["id","event_type","credits","description","created_at","metadata"],"title":"CreditLedgerEntry"},"core__schemas__conglomerate__CreditLedgerResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/core__schemas__conglomerate__CreditLedgerEntry"},"type":"array","title":"Entries"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["entries","total","has_more"],"title":"CreditLedgerResponse"},"core__schemas__support__CreditLedgerEntry":{"properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"type":{"type":"string","title":"Type"},"credits":{"type":"number","title":"Credits"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["type","credits"],"title":"CreditLedgerEntry"},"core__schemas__support__CreditLedgerResponse":{"properties":{"found":{"type":"boolean","title":"Found","default":true},"credit_balance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credit Balance"},"entries":{"items":{"$ref":"#/components/schemas/core__schemas__support__CreditLedgerEntry"},"type":"array","title":"Entries"}},"type":"object","title":"CreditLedgerResponse"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}