{"openapi":"3.1.0","info":{"title":"AdvisorPPC API","version":"0.1.0"},"paths":{"/api/leads":{"post":{"tags":["leads"],"summary":"Create Lead","operationId":"create_lead_api_leads_post","parameters":[{"name":"X-Turnstile-Token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Turnstile-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["leads"],"summary":"List Leads","operationId":"list_leads_api_leads_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LeadOut"},"title":"Response List Leads Api Leads Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/traffic/hit":{"post":{"tags":["traffic"],"summary":"Record Hit","description":"Count one public page view. Always 204, whatever happens.\n\nThe browser sends this as a no-cors text/plain POST without cookies and\nnever reads the answer, so there is nothing useful to tell it. A hit that\nfails a check is dropped quietly; a database error is logged and dropped,\nnever surfaced to a reader's page.","operationId":"record_hit_api_traffic_hit_post","responses":{"204":{"description":"Successful Response"}}}},"/api/traffic/daily":{"get":{"tags":["traffic"],"summary":"Daily Traffic","description":"Visitors and page views per owner day for the public site.\n\nPlatform-wide, so platform superusers only. The table holds no tenant\ndata and no RLS, so no tenant GUC is set.","operationId":"daily_traffic_api_traffic_daily_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":7,"default":30,"title":"Days"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Daily Traffic Api Traffic Daily Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/content/case-studies":{"get":{"tags":["content"],"summary":"Case Studies","operationId":"case_studies_api_content_case_studies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CaseStudyOut"},"type":"array","title":"Response Case Studies Api Content Case Studies Get"}}}}}}},"/api/content/testimonials":{"get":{"tags":["content"],"summary":"Testimonials","operationId":"testimonials_api_content_testimonials_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TestimonialOut"},"type":"array","title":"Response Testimonials Api Content Testimonials Get"}}}}}}},"/api/content/faqs":{"get":{"tags":["content"],"summary":"Faqs","operationId":"faqs_api_content_faqs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FaqOut"},"type":"array","title":"Response Faqs Api Content Faqs Get"}}}}}}},"/api/email/unsubscribe":{"get":{"tags":["email"],"summary":"Unsubscribe Confirm","operationId":"unsubscribe_confirm_api_email_unsubscribe_get","parameters":[{"name":"t","in":"query","required":false,"schema":{"type":"string","maxLength":64,"default":"","title":"T"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["email"],"summary":"Unsubscribe","operationId":"unsubscribe_api_email_unsubscribe_post","parameters":[{"name":"t","in":"query","required":false,"schema":{"type":"string","maxLength":64,"default":"","title":"T"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/register":{"post":{"tags":["auth"],"summary":"Register","operationId":"register_api_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login":{"post":{"tags":["auth"],"summary":"Login","operationId":"login_api_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/password/forgot":{"post":{"tags":["auth"],"summary":"Forgot Password","description":"Email a single-use reset link if the address belongs to an account.\n\nAlways answers 202 with the same body. Reporting \"no such account\" here\nwould turn the endpoint into a customer-list oracle, so the only signal a\ncaller gets is that the request was accepted.","operationId":"forgot_password_api_auth_password_forgot_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordForgotIn"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordForgotOut"}}}},"429":{"description":"Too many reset requests from this client."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/password/reset":{"post":{"tags":["auth"],"summary":"Reset Password","description":"Set a new password from an emailed reset token.\n\nThe caller is NOT signed in as a side effect: whoever holds the link proved\ncontrol of the mailbox, not of a browser session, and minting a session here\nwould hand one to anyone who could read the email in transit. The frontend\nsends them to the sign-in form with the new password instead.","operationId":"reset_password_api_auth_password_reset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetOut"}}}},"400":{"description":"The reset link is invalid, expired or already used."},"429":{"description":"Too many reset attempts from this client."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/me":{"get":{"tags":["auth"],"summary":"Me","description":"Return the minimal actor and active-workspace capability DTO.\n\nClients use this only to hide controls that are guaranteed to fail. Every\nmutation still enforces its own backend role dependency, so this display\nmetadata never becomes an authorization boundary.","operationId":"me_api_auth_me_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login-emails":{"get":{"tags":["auth"],"summary":"List Login Emails","operationId":"list_login_emails_api_auth_login_emails_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginEmailsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["auth"],"summary":"Add Login Email Route","description":"Add a pending alias and mail its confirmation link to that address.","operationId":"add_login_email_route_api_auth_login_emails_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginEmailIn"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginEmailOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login-emails/{row_id}/resend":{"post":{"tags":["auth"],"summary":"Resend Login Email Route","operationId":"resend_login_email_route_api_auth_login_emails__row_id__resend_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"integer","title":"Row Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginEmailOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login-emails/verify":{"post":{"tags":["auth"],"summary":"Verify Login Email Route","description":"Redeem a confirmation link. Unauthenticated on purpose: holding the\nlink proves control of the mailbox, and the reader may be on a device\nthat is not signed in. Shares the reset flow's redeem window: nothing is\nmailed here, and a shared office address must not lock a colleague out.","operationId":"verify_login_email_route_api_auth_login_emails_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyLoginEmailIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyLoginEmailOut"}}}},"429":{"description":"Too many attempts from this client."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login-emails/{row_id}":{"delete":{"tags":["auth"],"summary":"Remove Login Email Route","operationId":"remove_login_email_route_api_auth_login_emails__row_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"integer","title":"Row Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login-emails/{row_id}/make-primary":{"post":{"tags":["auth"],"summary":"Make Primary Login Email Route","description":"Swap a verified alias with the primary address. The old primary stays\nusable as a verified alias, so no door closes.","operationId":"make_primary_login_email_route_api_auth_login_emails__row_id__make_primary_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"integer","title":"Row Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrimaryEmailOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/workspace/auto-model-bias":{"patch":{"tags":["auth"],"summary":"Set Auto Model Bias","description":"Set how hard composer Auto may spend for the caller's workspace.\n\nScoped to ``ctx.tenant_id``, so a caller cannot change a workspace they are\nnot currently in. Admin-gated for the same reason the rename is: it changes\nwhat every member of the workspace is billed for on an Auto turn.\n\nThis grants no entitlement. Every lane the bias can select is one the\nworkspace's plan already permits, the plan gates in ``routers/chat`` still\nrun after Auto resolves, and the free plan ignores the bias outright — so\nthe worst a member can do with it is choose a costlier model they were\nalready allowed to pick by hand.","operationId":"set_auto_model_bias_api_auth_workspace_auto_model_bias_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoModelBiasIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoModelBiasOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/workspace":{"patch":{"tags":["auth"],"summary":"Rename Workspace","description":"Set the current workspace's display name.\n\nScoped to `ctx.tenant_id`, so the tenant id is never taken from the request\nand a caller cannot rename a workspace they are not currently in. Every user\nis owner of their own personal tenant, which is the intent here — naming\nyour own workspace is not a privileged platform action.","operationId":"rename_workspace_api_auth_workspace_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceNameIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceNameOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/account":{"delete":{"tags":["auth"],"summary":"Delete Account","description":"Permanently delete the currently authenticated user account.\n\nConfirmation must equal the actor's current email. API keys cannot delete\ntheir owning user, and a platform superuser cannot delete an identity while\nacting as another tenant.","operationId":"delete_account_api_auth_account_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDeletionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDeletionOut"}}}},"400":{"description":"Explicit email confirmation did not match."},"401":{"description":"Current-user authentication is required."},"403":{"description":"Interactive self-service authentication required."},"409":{"description":"Deletion would orphan a workspace or an active subscription."},"503":{"description":"A connector grant could not be revoked safely."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","description":"Clear the HttpOnly app_token session cookie (slice 26).\n\nSince the token cookie is HttpOnly it cannot be cleared from JavaScript, so\nlogout must round-trip to the server. Path/SameSite must match the set so the\nbrowser actually drops it. No auth required — clearing your own session is\nalways safe and idempotent.","operationId":"logout_api_auth_logout_post","responses":{"204":{"description":"Successful Response"}}}},"/api/auth/google/start":{"get":{"tags":["auth"],"summary":"Google Start","description":"Begin Sign in with Google: 302 to accounts.google.com with PKCE + state.\n\nThe state and PKCE verifier are stored in short-lived HttpOnly cookies and\nchecked on the callback (CSRF + PKCE binding).","operationId":"google_start_api_auth_google_start_get","parameters":[{"name":"flow","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flow"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"touch","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Touch"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/google/callback":{"get":{"tags":["auth"],"summary":"Google Callback","description":"Complete Sign in with Google: verify state, exchange the code, verify the\nid_token, upsert the User by google_sub, mint the app_token JWT, and redirect\nthe browser to the logged-in app with the token in the URL fragment.","operationId":"google_callback_api_auth_google_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"g_oauth_state","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"G Oauth State"}},{"name":"g_oauth_verifier","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"G Oauth Verifier"}},{"name":"g_oauth_flow","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"G Oauth Flow"}},{"name":"g_oauth_from","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"G Oauth From"}},{"name":"g_oauth_touch","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"G Oauth Touch"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/api-keys":{"post":{"tags":["auth"],"summary":"Create Key","operationId":"create_key_api_auth_api_keys_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Key Api Auth Api Keys Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["auth"],"summary":"List Keys","operationId":"list_keys_api_auth_api_keys_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Keys Api Auth Api Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/api-keys/{key_id}":{"delete":{"tags":["auth"],"summary":"Revoke Key","operationId":"revoke_key_api_auth_api_keys__key_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/runtime/handoff":{"post":{"tags":["connectors"],"summary":"Start Runtime Handoff","description":"Mint the signed URL that logs this member into the connector runtime.\n\nThe site and the runtime keep separate user tables. Before this route, a\ncustomer who subscribed here and was sent to mcp.advisorppc.com arrived as\na stranger and their site password was rejected (#153). This hands the\nruntime a short-lived, single-use assertion of who they are, which tenant\nthey belong to, and what they are paying for, so the runtime can create or\nlink its own account instead of asking them to sign in again.\n\nAdmin-gated like the sibling ``/{slug}/oauth/start`` and\n``/{slug}/review/start`` routes: the runtime turns the assertion into a\npersonal account carrying this tenant's paid plan, so a read-only member\nmust not be able to mint one. Interactive sessions only — an API key is a\nmachine credential and must not be upgradable into a browser session for\nits owner — and never under superuser act-as, which would stamp the\ncustomer's tenant and plan onto the operator's own runtime identity.\n\nPOST rather than GET on purpose: the response body is a credential, and a\nGET would be prefetchable, linkable and loggable as a URL.","operationId":"start_runtime_handoff_api_connectors_runtime_handoff_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RuntimeHandoffIn"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuntimeHandoffOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors":{"get":{"tags":["connectors"],"summary":"List Connectors","operationId":"list_connectors_api_connectors_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ConnectorOut"},"title":"Response List Connectors Api Connectors Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/context":{"get":{"tags":["connectors"],"summary":"Connector Context","description":"Return a short-lived cached context shared by web, iOS, and chat.\n\nEvery account is returned by default: this response is what the connectors\nUI can select from, so a trimmed list makes real accounts unreachable. A\nclient that wants a bounded payload passes ``accounts_offset``/\n``accounts_limit`` and pages with ``accounts_page.has_more``.","operationId":"connector_context_api_connectors_context_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"accounts_offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"First account index to return per connector.","default":0,"title":"Accounts Offset"},"description":"First account index to return per connector."},{"name":"accounts_limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Accounts to return per connector. Omit for every account; the read model is not bounded by the model-context list limit.","title":"Accounts Limit"},"description":"Accounts to return per connector. Omit for every account; the read model is not bounded by the model-context list limit."},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Connector Context Api Connectors Context Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/catalog":{"get":{"tags":["connectors"],"summary":"Connector Catalog","description":"Paint the connector grid without waiting on live account inventory.\n\nUses a still-warm (or just-expired) context cache when one exists so a\nrepeat visit can show last-known accounts immediately. On a cache miss it\nreturns the static catalogue plus this tenant's stored grants and managed\nselections. It does not call the MCP bridge and does not verify identity;\n``GET /context`` remains the live authority.","operationId":"connector_catalog_api_connectors_catalog_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Connector Catalog Api Connectors Catalog Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{slug}/accounts":{"put":{"tags":["connectors"],"summary":"Replace Connector Accounts","description":"Atomically replace one connector's managed provider-resource set.\n\nNon-empty account ids are validated against a fresh tenant runtime\nsnapshot. An empty set is a serialized local scope reduction and remains\navailable even when the bridge is unavailable.","operationId":"replace_connector_accounts_api_connectors__slug__accounts_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorManagedAccountsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorManagedAccountsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{slug}/accounts/default":{"put":{"tags":["connectors"],"summary":"Set Connector Default Account","description":"Move this connector's default onto another account it already manages.\n\nDeliberately NOT part of the replace endpoint's path: which accounts are\nmanaged is a plan-priced decision that advances the selection generation\nand throws away the reporting cache, while which of them is the default is\na preference that changes neither. Making the customer re-run the first to\nexpress the second is how \"switch account\" ends up feeling expensive.","operationId":"set_connector_default_account_api_connectors__slug__accounts_default_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorDefaultAccountIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorDefaultAccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{slug}/selection":{"put":{"tags":["connectors"],"summary":"Select Connection","description":"Select a previously authorized Google identity for one service.","operationId":"select_connection_api_connectors__slug__selection_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorSelectionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorSelectionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{slug}/connect":{"post":{"tags":["connectors"],"summary":"Connect","operationId":"connect_api_connectors__slug__connect_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{slug}/oauth/start":{"post":{"tags":["connectors"],"summary":"Oauth Start","operationId":"oauth_start_api_connectors__slug__oauth_start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthStartOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{slug}/review/start":{"post":{"tags":["connectors"],"summary":"Review Start","description":"Mint one tenant-bound, review-only browser handoff.","operationId":"review_start_api_connectors__slug__review_start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewStartOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{slug}/oauth/import":{"post":{"tags":["connectors"],"summary":"Oauth Import","description":"Admin: seed a Google OAuth connector from a pre-existing refresh token\n(founder-held, e.g. ~/ENV/google-ads-tokens). Validates by exchanging the\ntoken for an access token and enforcing the connector's required scopes,\nthen persists the encrypted grant — no browser consent, so this works even\nwhen the connector redirect URI is not yet registered in Google Console.\nBody: {\"refresh_token\": \"...\"}.","operationId":"oauth_import_api_connectors__slug__oauth_import_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/oauth/callback":{"get":{"tags":["connectors"],"summary":"Oauth Callback","description":"Google OAuth redirect handler. No auth dependency: identity comes from\nthe HMAC-signed ``state`` AND the HttpOnly flow cookie this browser was\ngiven at oauth/start. Verifies both, redeems the code with the cookie's\nPKCE verifier, enforces the granted scopes cover the requested scopes,\nre-checks the member is still an admin, encrypts + stores the tokens\ntenant-scoped, and redirects back to the connectors page with a result.","operationId":"oauth_callback_api_connectors_oauth_callback_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/runtime/oauth/callback":{"get":{"tags":["connectors"],"summary":"Runtime Oauth Callback","description":"Finish tenant DCR+PKCE and persist only a runtime-verified bearer.","operationId":"runtime_oauth_callback_api_connectors_runtime_oauth_callback_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{slug}":{"delete":{"tags":["connectors"],"summary":"Disconnect","operationId":"disconnect_api_connectors__slug__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/credentials/status":{"get":{"tags":["connectors"],"summary":"Credentials Status","operationId":"credentials_status_api_connectors_credentials_status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialStatusListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connectors/{slug}/credentials/rotate":{"post":{"tags":["connectors"],"summary":"Rotate Credential","operationId":"rotate_credential_api_connectors__slug__credentials_rotate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/chatgpt/tools/call":{"post":{"tags":["internal-chatgpt"],"summary":"Call Reviewed Tool","description":"Run one reviewed tool under the main site's current tenant policy.","operationId":"call_reviewed_tool_api_internal_chatgpt_tools_call_post","parameters":[{"name":"X-AdvisorPPC-Internal-Secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Advisorppc-Internal-Secret"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatGPTToolCall"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Call Reviewed Tool Api Internal Chatgpt Tools Call Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/insights/summary":{"get":{"tags":["insights"],"summary":"Summary","operationId":"summary_api_insights_summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Narrow the report to one provider, e.g. google_ads.","title":"Platform"},"description":"Narrow the report to one provider, e.g. google_ads."},{"name":"accountId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Narrow the report to one account of that provider.","title":"Accountid"},"description":"Narrow the report to one account of that provider."},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightsSummaryOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/insights/campaigns":{"get":{"tags":["insights"],"summary":"List Reporting Campaigns","description":"Receipt-backed campaigns for every managed account, not just OpenAI.","operationId":"list_reporting_campaigns_api_insights_campaigns_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Narrow the list to one provider, e.g. google_ads.","title":"Platform"},"description":"Narrow the list to one provider, e.g. google_ads."},{"name":"accountId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Narrow the list to one account of that provider.","title":"Accountid"},"description":"Narrow the list to one account of that provider."},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportingCampaignsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/insights/live":{"get":{"tags":["insights"],"summary":"Live","description":"The four auto-refreshing Overview cards.\n\nPolled every ``refresh_seconds`` by the page. Reads stored rows only —\nno provider is called here; the daily tick is what refreshes the rows —\nso a poll costs a handful of indexed queries. Every card states whether\nits number was measured; the page shows that state, never a fake zero.","operationId":"live_api_insights_live_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightsLiveOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/insights/overview":{"get":{"tags":["insights"],"summary":"Overview Bundle","description":"The whole Overview in one consistent read (CONTRACT-OVERVIEW-V2).\n\nStored data only: this route triggers no provider request, no discovery and\nno job. Three separate GETs could not stay coherent while accounts publish\nindependently; one bundle can.","operationId":"overview_bundle_api_insights_overview_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"contract_version","in":"query","required":false,"schema":{"type":"integer","description":"Wire contract version; only 2 is served here.","default":2,"title":"Contract Version"},"description":"Wire contract version; only 2 is served here."},{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform"}},{"name":"accountId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accountid"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Overview Bundle Api Insights Overview Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/insights/status":{"get":{"tags":["insights"],"summary":"Overview Status","description":"The 60-second visible-tab poll: scope, generation, scheduler, reporting.","operationId":"overview_status_api_insights_status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform"}},{"name":"accountId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accountid"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Overview Status Api Insights Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/insights/activity":{"post":{"tags":["insights"],"summary":"Record Reporting Activity","description":"Record a visible viewer's activity using Postgres only.\n\nAcknowledgement never means a provider was contacted or source data became\nfresh. Cookie/CORS authentication is the same as the other app routes;\nan explicitly untrusted browser origin cannot mutate this lease.","operationId":"record_reporting_activity_api_insights_activity_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportingActivityRequestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Record Reporting Activity Api Insights Activity Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/insights/refresh":{"post":{"tags":["insights"],"summary":"Refresh Stored Reporting","description":"Join or request a reporting refresh behind the source-age gate. Never provider I/O.\n\nHTTP 200 means the request was recorded, not that data was refreshed. While\nthe stored source is 12 hours old or newer an account answers ``idle`` and\nnothing is queued. Repeated clicks, extra tabs and other users all join the\nsame open job, which keeps the account inside its 2-per-24h ceiling.","operationId":"refresh_stored_reporting_api_insights_refresh_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform"}},{"name":"accountId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accountid"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RefreshRequestIn"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Refresh Stored Reporting Api Insights Refresh Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ads/openai/campaigns":{"get":{"tags":["ads"],"summary":"List Campaigns","operationId":"list_campaigns_api_ads_openai_campaigns_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ads/openai/campaigns/{campaign_id}/pause":{"post":{"tags":["ads"],"summary":"Pause Campaign","operationId":"pause_campaign_api_ads_openai_campaigns__campaign_id__pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ads/openai/campaigns/{campaign_id}/activate":{"post":{"tags":["ads"],"summary":"Activate Campaign","operationId":"activate_campaign_api_ads_openai_campaigns__campaign_id__activate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ads/campaigns":{"get":{"tags":["ads"],"summary":"List Shared Campaigns","operationId":"list_shared_campaigns_api_ads_campaigns_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ads/campaigns/{campaign_id}/pause":{"post":{"tags":["ads"],"summary":"Pause Shared Campaign","operationId":"pause_shared_campaign_api_ads_campaigns__campaign_id__pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ads/campaigns/{campaign_id}/activate":{"post":{"tags":["ads"],"summary":"Activate Shared Campaign","operationId":"activate_shared_campaign_api_ads_campaigns__campaign_id__activate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/knowledge/search":{"get":{"tags":["knowledge"],"summary":"Search","operationId":"search_api_knowledge_search_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":2000,"title":"Q"}},{"name":"library","in":"query","required":false,"schema":{"enum":["engineering","adtech","all"],"type":"string","default":"all","title":"Library"}},{"name":"k","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":6,"title":"K"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeSearchOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/attachments":{"post":{"tags":["chat"],"summary":"Initiate Chat Attachment","description":"Reserved upload contract, disabled until its security rail is real.\n\nParsing still enforces the public filename, MIME, size, and digest bounds.\nNo metadata row is created and no client bytes are accepted.","operationId":"initiate_chat_attachment_api_chat_attachments_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAttachmentUploadIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAttachmentUploadOut"}}}},"503":{"description":"Upload initiation is disabled until durable storage and content inspection are configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAttachmentErrorOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat":{"post":{"tags":["chat"],"summary":"Chat","operationId":"chat_api_chat_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Attachment not found in the actor's tenant scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAttachmentErrorOut"}}}},"409":{"description":"Attachment metadata is not ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAttachmentErrorOut"}}}},"410":{"description":"Attachment metadata has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAttachmentErrorOut"}}}},"413":{"description":"Combined attachment size exceeds the turn limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAttachmentErrorOut"}}}},"503":{"description":"Chat or attachment delivery is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAttachmentErrorOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/actions/{action_id}/approve":{"post":{"tags":["chat-actions"],"summary":"Approve Action","description":"Approve one STAGED chat action and execute it through the executor\nrail. The staged->approved claim is one atomic conditional UPDATE, so a\nlost race answers 409 and the write can never fire twice. On a PRE-WRITE\nexecutor refusal (e.g. writes disabled -> 403) the row is re-staged in\nthis same request so a later retry genuinely works; after an ambiguous\ntool error the row stays 'approved' for human review.","operationId":"approve_action_api_chat_actions__action_id__approve_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"action_id","in":"path","required":true,"schema":{"type":"integer","title":"Action Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/actions/{action_id}/deny":{"post":{"tags":["chat-actions"],"summary":"Deny Action","description":"Deny one STAGED chat action: status='rejected', nothing runs.\nIdempotent: any non-staged status answers 409.","operationId":"deny_action_api_chat_actions__action_id__deny_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"action_id","in":"path","required":true,"schema":{"type":"integer","title":"Action Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/sessions/{thread_id}/agent-runs":{"post":{"tags":["chat","agents"],"summary":"Start Chat Agent Run","operationId":"start_chat_agent_run_api_chat_sessions__thread_id__agent_runs_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"integer","title":"Thread Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartChatAgentRunIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAgentRunOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["chat","agents"],"summary":"List Chat Agent Runs","operationId":"list_chat_agent_runs_api_chat_sessions__thread_id__agent_runs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"integer","title":"Thread Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAgentRunListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/mcp-app/call-tool":{"post":{"tags":["chat"],"summary":"Call Tool","description":"Proxy one view ``tools/call``; only chat's read-only tools pass.","operationId":"call_tool_api_chat_mcp_app_call_tool_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpAppCallIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Call Tool Api Chat Mcp App Call Tool Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/mcp-app/resource":{"post":{"tags":["chat"],"summary":"Read Resource","description":"The HTML document behind one ``ui://`` view.","operationId":"read_resource_api_chat_mcp_app_resource_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpAppResourceIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Read Resource Api Chat Mcp App Resource Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/runs/by-request/{client_request_id}":{"get":{"tags":["chat"],"summary":"By Request","operationId":"by_request_api_chat_runs_by_request__client_request_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_request_id","in":"path","required":true,"schema":{"type":"string","title":"Client Request Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response By Request Api Chat Runs By Request  Client Request Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/runs/by-request/{client_request_id}/cancel":{"post":{"tags":["chat"],"summary":"Cancel By Request","operationId":"cancel_by_request_api_chat_runs_by_request__client_request_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_request_id","in":"path","required":true,"schema":{"type":"string","title":"Client Request Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel By Request Api Chat Runs By Request  Client Request Id  Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/runs/{run_id}/events":{"get":{"tags":["chat"],"summary":"Events","operationId":"events_api_chat_runs__run_id__events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}},{"name":"after","in":"query","required":false,"schema":{"type":"integer","maximum":9007199254740991,"minimum":0,"default":0,"title":"After"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/runs/{run_id}/cancel":{"post":{"tags":["chat"],"summary":"Cancel","operationId":"cancel_api_chat_runs__run_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel Api Chat Runs  Run Id  Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/harness/configs":{"post":{"tags":["agents"],"summary":"Configure","operationId":"configure_api_agents_harness_configs_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigureIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/harness/configs/{config_id}/confirm":{"post":{"tags":["agents"],"summary":"Confirm","operationId":"confirm_api_agents_harness_configs__config_id__confirm_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"config_id","in":"path","required":true,"schema":{"type":"integer","title":"Config Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/harness/configs/{config_id}/start":{"post":{"tags":["agents"],"summary":"Start","operationId":"start_api_agents_harness_configs__config_id__start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"config_id","in":"path","required":true,"schema":{"type":"integer","title":"Config Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/harness/configs/{config_id}/pause":{"post":{"tags":["agents"],"summary":"Pause","operationId":"pause_api_agents_harness_configs__config_id__pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"config_id","in":"path","required":true,"schema":{"type":"integer","title":"Config Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/harness/invocations/{invocation_id}":{"get":{"tags":["agents"],"summary":"Status","operationId":"status_api_agents_harness_invocations__invocation_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"invocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Invocation Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/harness/invocations/{invocation_id}/cancel":{"post":{"tags":["agents"],"summary":"Cancel","operationId":"cancel_api_agents_harness_invocations__invocation_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"invocation_id","in":"path","required":true,"schema":{"type":"integer","title":"Invocation Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/questions/{question_id}/answer":{"post":{"tags":["agents"],"summary":"Answer","operationId":"answer_api_chat_questions__question_id__answer_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"question_id","in":"path","required":true,"schema":{"type":"integer","title":"Question Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__agent_harness__AnswerIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/sessions":{"get":{"tags":["chat"],"summary":"List Sessions","operationId":"list_sessions_api_chat_sessions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Sessions Api Chat Sessions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/sessions/{thread_id}":{"get":{"tags":["chat"],"summary":"Get Session","operationId":"get_session_api_chat_sessions__thread_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"integer","title":"Thread Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Session Api Chat Sessions  Thread Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["chat"],"summary":"Delete Session","operationId":"delete_session_api_chat_sessions__thread_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"integer","title":"Thread Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reports/{token}":{"get":{"tags":["reports"],"summary":"Download Report","description":"Return one report's PDF bytes for the calling tenant.","operationId":"download_report_api_reports__token__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/geo/search-console/sites":{"get":{"tags":["geo"],"summary":"List Search Console Sites","operationId":"list_search_console_sites_api_geo_search_console_sites_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Search Console Sites Api Geo Search Console Sites Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["geo"],"summary":"Add Search Console Site","operationId":"add_search_console_site_api_geo_search_console_sites_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmSiteIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Add Search Console Site Api Geo Search Console Sites Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/geo/search-console/performance":{"get":{"tags":["geo"],"summary":"Search Console Performance","operationId":"search_console_performance_api_geo_search_console_performance_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"site_url","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Site Url"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}},{"name":"dimension","in":"query","required":false,"schema":{"type":"string","default":"query","title":"Dimension"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Search Console Performance Api Geo Search Console Performance Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/geo/search-console/sitemaps":{"post":{"tags":["geo"],"summary":"Submit Sitemap","operationId":"submit_sitemap_api_geo_search_console_sitemaps_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SitemapIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Submit Sitemap Api Geo Search Console Sitemaps Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["geo"],"summary":"Delete Sitemap","operationId":"delete_sitemap_api_geo_search_console_sitemaps_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Sitemap Api Geo Search Console Sitemaps Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/geo/keywords/ideas":{"post":{"tags":["geo"],"summary":"Keyword Ideas","operationId":"keyword_ideas_api_geo_keywords_ideas_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeywordIdeasIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Keyword Ideas Api Geo Keywords Ideas Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/geo/reports":{"post":{"tags":["geo"],"summary":"Create Geo Report","operationId":"create_geo_report_api_geo_reports_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Geo Report Api Geo Reports Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/geo/brand-profile":{"get":{"tags":["geo"],"summary":"Get Brand Profile","operationId":"get_brand_profile_api_geo_brand_profile_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Brand Profile Api Geo Brand Profile Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["geo"],"summary":"Put Brand Profile","operationId":"put_brand_profile_api_geo_brand_profile_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandProfileIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Put Brand Profile Api Geo Brand Profile Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/commerce/impact/daily":{"get":{"tags":["commerce"],"summary":"Get Daily Business Impact","description":"Return one source-backed UTC day.\n\nWithout ``day``, the response uses the last completed UTC day. An explicit\n``day`` is returned unchanged.","operationId":"get_daily_business_impact_api_commerce_impact_daily_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"day","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Day"}},{"name":"currency","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":3,"maxLength":3,"pattern":"^[A-Za-z]{3}$"},{"type":"null"}],"title":"Currency"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyBusinessImpactOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces":{"get":{"tags":["native-projects"],"summary":"Get Workspaces","operationId":"get_workspaces_api_v1_workspaces_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__compat_projects_schemas__WorkspacesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/connected-accounts":{"get":{"tags":["native-projects"],"summary":"Get Connected Accounts","operationId":"get_connected_accounts_api_v1_connected_accounts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"orgId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orgid"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConnectedAccountOut"}},{"$ref":"#/components/schemas/ConnectedAccountsEnvelope"}],"title":"Response Get Connected Accounts Api V1 Connected Accounts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounts/chat-thread":{"post":{"tags":["account-chat"],"summary":"Open Account Chat","description":"Find or create this actor's chat thread for one provider account.","operationId":"open_account_chat_api_v1_accounts_chat_thread_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountChatOpenIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountChatOpenOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/accounts/chat-context":{"get":{"tags":["account-chat"],"summary":"Account Chat Context","description":"Identity card for the account bar above a scoped chat.","operationId":"account_chat_context_api_v1_accounts_chat_context_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"platform","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":50,"title":"Platform"}},{"name":"accountId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":2048,"title":"Accountid"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountCardOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mobile/auth/login":{"post":{"tags":["mobile-compat"],"summary":"Mobile Login","operationId":"mobile_login_api_mobile_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Mobile Login Api Mobile Auth Login Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mobile/auth/signup":{"post":{"tags":["mobile-compat"],"summary":"Mobile Signup","operationId":"mobile_signup_api_mobile_auth_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Mobile Signup Api Mobile Auth Signup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mobile/auth/google/exchange":{"post":{"tags":["mobile-compat"],"summary":"Mobile Google Exchange","description":"Swap the 2-minute exchange code from the native Google-login redirect\n(advisorppc://auth/callback?code=…) for a session JWT + user envelope.","operationId":"mobile_google_exchange_api_mobile_auth_google_exchange_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleExchangeIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Mobile Google Exchange Api Mobile Auth Google Exchange Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat":{"post":{"tags":["mobile-compat"],"summary":"Mobile Chat","operationId":"mobile_chat_api_v1_chat_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobileChatIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Mobile Chat Api V1 Chat Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/google-ads/campaigns":{"get":{"tags":["mobile-compat"],"summary":"Mobile Campaigns","operationId":"mobile_campaigns_api_v1_google_ads_campaigns_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"accountId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accountid"}},{"name":"dateRange","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Daterange"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/conversations":{"get":{"tags":["mobile-compat"],"summary":"Mobile Conversations","operationId":"mobile_conversations_api_v1_conversations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Mobile Conversations Api V1 Conversations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/managed":{"get":{"tags":["managed-agents"],"summary":"List Managed","operationId":"list_managed_api_agents_managed_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Managed Api Agents Managed Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/managed/chat":{"post":{"tags":["managed-agents"],"summary":"Managed Chat","operationId":"managed_chat_api_agents_managed_chat_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedChatIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManagedChatOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/builder/chat":{"post":{"tags":["agent-builder"],"summary":"Builder Chat","operationId":"builder_chat_api_agents_builder_chat_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuilderChatIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/builder/sessions/{sid}":{"get":{"tags":["agent-builder"],"summary":"Get Builder Session","operationId":"get_builder_session_api_agents_builder_sessions__sid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"integer","title":"Sid"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Builder Session Api Agents Builder Sessions  Sid  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/builder/tools":{"get":{"tags":["agent-builder"],"summary":"Builder Tools","operationId":"builder_tools_api_agents_builder_tools_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Builder Tools Api Agents Builder Tools Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/custom":{"post":{"tags":["agent-builder"],"summary":"Create Custom Agent","description":"Create a tenant-scoped custom AgentDefinition from a validated draft.","operationId":"create_custom_agent_api_agents_custom_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveCustomIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCardOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/custom/{key}":{"delete":{"tags":["agent-builder"],"summary":"Delete Custom Agent","description":"Delete one of this workspace's custom agents.\n\nIt leaves the catalog, its manager is paused so the scheduler never runs\nit again, and it frees a place under the custom-agent limit. The row is\narchived rather than removed, so its past runs, recommendations and audit\ntrail stay readable. Built-in managers cannot be deleted (404).","operationId":"delete_custom_agent_api_agents_custom__key__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/{instance_id}":{"patch":{"tags":["agents"],"summary":"Set Agent Prefs","operationId":"set_agent_prefs_api_agents__instance_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"integer","title":"Instance Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrefsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrefsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/{instance_id}/accounts":{"put":{"tags":["agents"],"summary":"Set Agent Accounts","description":"Point one agent at specific accounts, or clear it back to the default.\n\nAdmin, not superuser: unlike the engine above, which account an agent\nreports on is the client's own decision. Writing the whole mapping in one\ncall keeps it atomic — a picker that cleared one connector and set another\nwould otherwise leave the agent half-configured between two requests.","operationId":"set_agent_accounts_api_agents__instance_id__accounts_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"integer","title":"Instance Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents":{"get":{"tags":["agents"],"summary":"List Agents","description":"The global catalog merged with this tenant's instance state.","operationId":"list_agents_api_agents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentCardOut"},"title":"Response List Agents Api Agents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/instances/{instance_id}/chat-context":{"get":{"tags":["agents"],"summary":"Get Agent Chat Context","description":"Small live read model used by the selected-agent main-chat header.","operationId":"get_agent_chat_context_api_agents_instances__instance_id__chat_context_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"integer","title":"Instance Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Agent Chat Context Api Agents Instances  Instance Id  Chat Context Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/{key}/enable":{"post":{"tags":["agents"],"summary":"Enable Agent","description":"Enable a definition for the tenant. Idempotent: re-enabling returns the\nexisting instance rather than erroring.","operationId":"enable_agent_api_agents__key__enable_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/EnableIn"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentInstanceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/{instance_id}/run":{"post":{"tags":["agents"],"summary":"Run Agent","description":"Queue a run for the instance and fire the read-only executor in the\nbackground (skipped when the agent runtime is not configured — the run\nstays ``queued`` for an out-of-band executor, exactly like tests that drive\n``run_agent_run`` directly with an injected client).","operationId":"run_agent_api_agents__instance_id__run_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"integer","title":"Instance Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunActionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/{instance_id}/status":{"patch":{"tags":["agents"],"summary":"Set Agent Status","description":"Pause/resume an enabled manager and its scheduler eligibility.\n\nThe scheduler enumerates active AgentInstance rows, so this is the single\ndurable switch used by web/iOS and unattended execution.","operationId":"set_agent_status_api_agents__instance_id__status_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"integer","title":"Instance Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceStatusIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentInstanceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/runs":{"get":{"tags":["agents"],"summary":"List Runs","description":"Runs + their questions, shaped for the task tab, with chip counts.\n\n``filter`` scopes the returned runs; ``limit`` bounds them (newest first,\ndefault 50, cap 200) so a 15s poll never materializes an unbounded history;\n``counts`` is always computed across ALL this tenant's runs (SQL aggregate)\nso the chip badges stay correct regardless of the filter or limit.","operationId":"list_runs_api_agents_runs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"filter","in":"query","required":false,"schema":{"enum":["all","needs_input","ready","working"],"type":"string","default":"all","title":"Filter"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agents/questions/{question_id}/answer":{"post":{"tags":["agents"],"summary":"Answer Question","description":"Store the tenant's answer, mark the question answered, and — when the\nquestion blocked a ``needs_input`` run and no other question is still\npending — flip that run back to ``queued`` (same commit as the answer, so\na process death cannot strand it) and resume it in the background.","operationId":"answer_question_api_agents_questions__question_id__answer_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"question_id","in":"path","required":true,"schema":{"type":"integer","title":"Question Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__agents__AnswerIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/anomalies":{"get":{"tags":["anomalies"],"summary":"List Open Flags","operationId":"list_open_flags_api_anomalies_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnomalyListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/anomalies/{flag_id}/ack":{"post":{"tags":["anomalies"],"summary":"Acknowledge Flag","operationId":"acknowledge_flag_api_anomalies__flag_id__ack_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"flag_id","in":"path","required":true,"schema":{"type":"integer","title":"Flag Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AckOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/goals":{"get":{"tags":["goals"],"summary":"List Goals","operationId":"list_goals_api_goals_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoalListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["goals"],"summary":"Create Goal","operationId":"create_goal_api_goals_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoalIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoalOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/goals/{goal_id}":{"patch":{"tags":["goals"],"summary":"Update Goal","operationId":"update_goal_api_goals__goal_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"goal_id","in":"path","required":true,"schema":{"type":"integer","title":"Goal Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoalPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoalOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["goals"],"summary":"Delete Goal","operationId":"delete_goal_api_goals__goal_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"goal_id","in":"path","required":true,"schema":{"type":"integer","title":"Goal Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoalDeleteOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/recommendations":{"get":{"tags":["recommendations"],"summary":"List Recommendations","operationId":"list_recommendations_api_recommendations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"staged","title":"Status"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecommendationListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/recommendations/{rec_id}/reject":{"post":{"tags":["recommendations"],"summary":"Reject Recommendation","operationId":"reject_recommendation_api_recommendations__rec_id__reject_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rec_id","in":"path","required":true,"schema":{"type":"integer","title":"Rec Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/recommendations/{rec_id}/approve":{"post":{"tags":["recommendations"],"summary":"Approve Recommendation","description":"Approve one STAGED recommendation (engine T7). Approval alone still\nexecutes nothing — the executor re-checks every hard gate at execute\ntime. An expired/rejected/executed/approved rec answers 409.","operationId":"approve_recommendation_api_recommendations__rec_id__approve_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rec_id","in":"path","required":true,"schema":{"type":"integer","title":"Rec Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/recommendations/{rec_id}/execute":{"post":{"tags":["recommendations"],"summary":"Execute Recommendation Endpoint","description":"Run the executor on one APPROVED recommendation. Human-triggered only\nin this phase — no scheduler path executes. All hard gates live in\napp/executor.py, fail-closed; refusals map to 403 (writes disabled),\n409 (state), 429 (daily cap), 422 (guardrail/allowlist/advice-only).","operationId":"execute_recommendation_endpoint_api_recommendations__rec_id__execute_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rec_id","in":"path","required":true,"schema":{"type":"integer","title":"Rec Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/rec-types/{rec_type}/reset":{"post":{"tags":["recommendations"],"summary":"Reset Rec Type","description":"Un-retire a rec type for this tenant (engine T9): zero the learning\ncounters and restore 'standard' gating so playbooks emit it again. Purely\na review-friction control — it grants no writes and changes no approve\ngate.","operationId":"reset_rec_type_api_rec_types__rec_type__reset_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rec_type","in":"path","required":true,"schema":{"type":"string","title":"Rec Type"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecTypeResetOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/playbooks/{key}/run":{"post":{"tags":["recommendations"],"summary":"Run Playbook","operationId":"run_playbook_api_playbooks__key__run_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookRunOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/executed-actions":{"get":{"tags":["executed-actions"],"summary":"List Executed Actions","operationId":"list_executed_actions_api_executed_actions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutedActionListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/executed-actions/{action_id}/rollback":{"post":{"tags":["executed-actions"],"summary":"Rollback Action","operationId":"rollback_action_api_executed_actions__action_id__rollback_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"action_id","in":"path","required":true,"schema":{"type":"integer","title":"Action Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollbackOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/social/capabilities":{"get":{"tags":["social"],"summary":"Get Social Capabilities","operationId":"get_social_capabilities_api_social_capabilities_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialCapabilitiesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/social/profile":{"get":{"tags":["social"],"summary":"Get Social Profile","operationId":"get_social_profile_api_social_profile_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Social Profile Api Social Profile Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/social/bindings":{"get":{"tags":["social"],"summary":"List Social Bindings","operationId":"list_social_bindings_api_social_bindings_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Social Bindings Api Social Bindings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/social/intents":{"post":{"tags":["social"],"summary":"Create Social Intent","operationId":"create_social_intent_api_social_intents_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialIntentCreateIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Social Intent Api Social Intents Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["social"],"summary":"List Social Intents","operationId":"list_social_intents_api_social_intents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"scheduled_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled From"}},{"name":"scheduled_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled To"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Social Intents Api Social Intents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/social/intents/{intent_id}":{"put":{"tags":["social"],"summary":"Edit Social Intent","operationId":"edit_social_intent_api_social_intents__intent_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"intent_id","in":"path","required":true,"schema":{"type":"integer","title":"Intent Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialIntentEditIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Edit Social Intent Api Social Intents  Intent Id  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/social/intents/{intent_id}/submit":{"post":{"tags":["social"],"summary":"Submit Social Intent","operationId":"submit_social_intent_api_social_intents__intent_id__submit_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"intent_id","in":"path","required":true,"schema":{"type":"integer","title":"Intent Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Submit Social Intent Api Social Intents  Intent Id  Submit Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/social/intents/{intent_id}/approve":{"post":{"tags":["social"],"summary":"Approve Social Intent","operationId":"approve_social_intent_api_social_intents__intent_id__approve_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"intent_id","in":"path","required":true,"schema":{"type":"integer","title":"Intent Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialDecisionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Approve Social Intent Api Social Intents  Intent Id  Approve Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/social/intents/{intent_id}/reject":{"post":{"tags":["social"],"summary":"Reject Social Intent","operationId":"reject_social_intent_api_social_intents__intent_id__reject_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"intent_id","in":"path","required":true,"schema":{"type":"integer","title":"Intent Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialDecisionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reject Social Intent Api Social Intents  Intent Id  Reject Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/social/outbox":{"get":{"tags":["social"],"summary":"List Social Outbox","operationId":"list_social_outbox_api_social_outbox_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Social Outbox Api Social Outbox Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/social/attempts":{"get":{"tags":["social"],"summary":"List Social Attempts","operationId":"list_social_attempts_api_social_attempts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Social Attempts Api Social Attempts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/social/audit":{"get":{"tags":["social"],"summary":"List Social Audit","operationId":"list_social_audit_api_social_audit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Social Audit Api Social Audit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/scheduler/reporting-tick":{"post":{"tags":["scheduler"],"summary":"Reporting Tick","description":"External-cron entry point for the 5-minute reporting dispatcher.\n\nSeparate from the daily agent tick on purpose: reporting must run for every\nselected account on a Free, no-agent workspace too, and it must keep its own\ncadence and its own heartbeat. Same fail-closed shared secret.","operationId":"reporting_tick_api_internal_scheduler_reporting_tick_post","parameters":[{"name":"x-scheduler-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Scheduler-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"},"title":"Response Reporting Tick Api Internal Scheduler Reporting Tick Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/scheduler/tick":{"post":{"tags":["scheduler"],"summary":"Scheduler Tick","description":"External-cron entry point. Idempotent per (instance, UTC day): call it\nas often as you like; each manager ticks at most once per day.","operationId":"scheduler_tick_api_internal_scheduler_tick_post","parameters":[{"name":"x-scheduler-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Scheduler-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"},"title":"Response Scheduler Tick Api Internal Scheduler Tick Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/ops-summary":{"get":{"tags":["internal-ops"],"summary":"Ops Summary","description":"App users, latest sales, bug reports, client chats, and signups and\npage views per blog post. Read only.","operationId":"ops_summary_api_internal_ops_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"X-Ops-Summary-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Ops-Summary-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Ops Summary Api Internal Ops Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/engine-mode":{"get":{"tags":["admin"],"summary":"Get Engine Mode","description":"Report whether advisor format is ON for chat and/or the agent runner.\n\nSuperuser like the PUT: this is PROCESS-GLOBAL configuration, and every\nuser owns their personal tenant, so a tenant-role gate would show internal\nengine posture to every customer.","operationId":"get_engine_mode_api_admin_engine_mode_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngineMode"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin"],"summary":"Set Engine Mode","description":"Superuser toggle: flip advisor format ON/OFF per call site on this worker.\n\nSECURITY (F2): this mutates PROCESS-GLOBAL ``settings`` (not tenant data), so\nit is gated on platform superuser, NOT tenant role — every user is owner of\ntheir personal tenant, so ``require_role(\"admin\")`` here let any logged-in\nuser flip the global engine mode.\n\nDefault posture is OFF (single-model Opus path). See the module docstring for\nthe durable env-var control and the multi-worker caveat.","operationId":"set_engine_mode_api_admin_engine_mode_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngineModePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngineMode"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/overview":{"get":{"tags":["admin"],"summary":"Admin Overview","description":"Aggregate the tenant's admin snapshot: connector health, usage vs cap,\nbilling state, and the Advisor-mode flag. Admin-only; tenant-scoped reads\nrun under the RLS GUC. Never returns a secret_ref.","operationId":"admin_overview_api_admin_overview_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Overview Api Admin Overview Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/advisor-mode":{"post":{"tags":["admin"],"summary":"Set Advisor Mode","description":"Superuser toggle for Advisor mode (both engine call sites at once).\n\nSECURITY (F2): maps onto the SAME process-global ``settings`` flags as\n``PUT /engine-mode``, so it is gated on platform superuser (not tenant role)\nfor the identical reason — a personal-tenant owner is not a platform operator.\n\nDEFAULT OFF; flipping it here changes only the running worker — the durable\nfleet-wide control is the ADVISORPPC_ADVISOR_ENABLED_* env vars.","operationId":"set_advisor_mode_api_admin_advisor_mode_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvisorModeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Advisor Mode Api Admin Advisor Mode Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tenants":{"get":{"tags":["admin"],"summary":"List Tenants","description":"Platform-wide tenant roster with each tenant's entitlement.\n\nCross-tenant by definition, so it runs on the audited superuser bypass path\nrather than pretending to be a tenant-scoped read. Returns no email address\nand no Stripe identifier — an operator picking a plan needs the tenant, its\ntier, and who owns the row, not the customer's PII.","operationId":"list_tenants_api_admin_tenants_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantRoster"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tenants/{tenant_id}/plan":{"post":{"tags":["admin"],"summary":"Set Tenant Plan","description":"Grant or revoke a tenant's entitlement without going through Stripe.\n\nRefuses outright when Stripe owns the row. That is the one case where\noverriding here would put the product and the payment processor into\ndisagreement about what a customer bought — change it in Stripe and let the\nwebhook land. Everything written here is ``billing_source='manual'`` with\nNULL Stripe ids, which the database enforces and the webhook receiver knows\nhow to conflict on.","operationId":"set_tenant_plan_api_admin_tenants__tenant_id__plan_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"integer","title":"Tenant Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanGrantIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantPlanRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/grants/by-email":{"post":{"tags":["admin"],"summary":"Grant Plan To Email","description":"Grant a plan to an e-mail address, creating the site account if needed.\n\nWhy this exists: this Stripe account also bills the connector runtime\n(mcp.advisorppc.com). Its customers check out on the runtime's storefront,\nand the site webhook drops their events as a foreign product on purpose,\nso a paying runtime customer who opens advisorppc.com lands on Free. This\nroute pre-provisions the site half — a password-less user that Sign in\nwith Google links to by e-mail, the personal tenant, and an audited manual\nentitlement — so they arrive on the plan they pay for.\n\nSame refusal as the tenant route: a row Stripe owns is never overwritten.\nIdempotent: repeating an identical grant reports ``changed=false`` and\nwrites no second audit row.","operationId":"grant_plan_to_email_api_admin_grants_by_email_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailGrantIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailGrantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tenants/{tenant_id}/account":{"get":{"tags":["admin"],"summary":"Get Tenant Account","description":"One account, in full: owner, plan, connectors, markers, model menu.\n\nCross-tenant by definition, so it runs on the audited superuser bypass path\n— the same one the roster and the plan grant use.","operationId":"get_tenant_account_api_admin_tenants__tenant_id__account_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"integer","title":"Tenant Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantAccount"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/support/conversations":{"get":{"tags":["admin"],"summary":"List Support Conversations","description":"Most recently active support conversations first.\n\n``offset`` pages past the newest ``limit``: ``total`` is returned so the\noperator can see there is more, and without an offset that number would\nbe a count of rows nobody could reach.\n\n``since`` filters on ``last_message_at`` (when the conversation was last\nALIVE, not when it started) because \"what have people been asking this\nweek\" is the question this endpoint exists to answer, and a long-running\nthread that started a month ago is part of that answer.","operationId":"list_support_conversations_api_admin_support_conversations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"}},{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tenant Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportConversationList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/support/conversations/{conversation_id}":{"get":{"tags":["admin"],"summary":"Get Support Conversation","description":"One conversation, every turn, in the order it happened.","operationId":"get_support_conversation_api_admin_support_conversations__conversation_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"integer","title":"Conversation Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportConversationDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stripe/checkout/{tier}":{"post":{"tags":["stripe"],"summary":"Create Checkout","operationId":"create_checkout_api_stripe_checkout__tier__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tier","in":"path","required":true,"schema":{"type":"string","title":"Tier"}},{"name":"cycle","in":"query","required":false,"schema":{"type":"string","default":"monthly","title":"Cycle"}},{"name":"switch","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Switch"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stripe/addons/{kind}":{"post":{"tags":["stripe"],"summary":"Add Addon","description":"Add extra accounts or seats to the tenant's live subscription.\n\nConfirm-then-charge: the connectors UI has already shown the price from\nthe priced 409 and the owner clicked. Stripe invoices the proration now;\nthe webhook makes the quantity durable. The row is updated here too so the\nowner's retry succeeds before the webhook lands.","operationId":"add_addon_api_stripe_addons__kind__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","title":"Kind"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AddonIn"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddonOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stripe/portal":{"post":{"tags":["stripe"],"summary":"Open Portal","description":"Open the Stripe billing portal for the tenant's linked customer.","operationId":"open_portal_api_stripe_portal_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stripe/webhook":{"post":{"tags":["stripe"],"summary":"Webhook","description":"Receive a Stripe event and apply it to per-tenant subscription state.\n\nNo user auth — authenticity is the Stripe signature (verified in\n``parse_event`` when a webhook secret is configured).","operationId":"webhook_api_stripe_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookOut"}}}}}}},"/api/billing/summary":{"get":{"tags":["billing"],"summary":"Billing Summary","operationId":"billing_summary_api_billing_summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Billing Summary Api Billing Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/usage":{"get":{"tags":["billing"],"summary":"Billing Usage","operationId":"billing_usage_api_billing_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cycle","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cycle"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Billing Usage Api Billing Usage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/invoices":{"get":{"tags":["billing"],"summary":"Billing Invoices","description":"Invoice history with Stripe PDF links — admin or owner only.","operationId":"billing_invoices_api_billing_invoices_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Month"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Billing Invoices Api Billing Invoices Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/portal":{"post":{"tags":["billing"],"summary":"Billing Portal","operationId":"billing_portal_api_billing_portal_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Billing Portal Api Billing Portal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/pause/preview":{"get":{"tags":["billing"],"summary":"Preview Pause Billing","operationId":"preview_pause_billing_api_billing_pause_preview_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Preview Pause Billing Api Billing Pause Preview Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/pause":{"post":{"tags":["billing"],"summary":"Pause Billing","operationId":"pause_billing_api_billing_pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PauseIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Pause Billing Api Billing Pause Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/resume":{"post":{"tags":["billing"],"summary":"Resume Billing","operationId":"resume_billing_api_billing_resume_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Resume Billing Api Billing Resume Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/cancel":{"post":{"tags":["billing"],"summary":"Cancel Plan","description":"Schedule the workspace's plan to end; repeating it changes nothing.\n\nTrialing: ends at the trial end, never charged. Active or paused: ends at\nthe end of the current period and does not renew. A receipt goes to the\nowner who clicked (co-owners CC'd) the first time only.","operationId":"cancel_plan_api_billing_cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel Plan Api Billing Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/cancel/confirm":{"post":{"tags":["billing"],"summary":"Retired Cancel Steps","operationId":"retired_cancel_steps_api_billing_cancel_confirm_post","responses":{"410":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Retired Cancel Steps Api Billing Cancel Confirm Post"}}}}}}},"/api/billing/cancel/request":{"post":{"tags":["billing"],"summary":"Retired Cancel Steps","operationId":"retired_cancel_steps_api_billing_cancel_request_post","responses":{"410":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Retired Cancel Steps Api Billing Cancel Request Post"}}}}}}},"/api/support/config":{"get":{"tags":["support"],"summary":"Support Config","description":"Feature flags for the public widget.\n\n``voice`` is the xAI voice agent. It is OFF and must stay off until the xAI\nconsole team is authorized for voice — the voice endpoint currently returns\n403 \"Team is not authorized to perform this action\" for our team.","operationId":"support_config_api_support_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Support Config Api Support Config Get"}}}}}}},"/api/support/search":{"get":{"tags":["support"],"summary":"Support Instant Search","description":"Instant answers from the knowledge file. No model, no spend.\n\nThis is the lane the widget searches while the visitor is still typing.\nEvery hit is the stored wording, quoted, so a plan fact reaches the\nvisitor exactly as the pricing page states it - and a visitor who finds\ntheir answer here has spent nothing and still has all five free messages\nfor the question that actually needs the agent.\n\nIt is GET on purpose: the response depends only on the query and the\ndeployed artifact, so a browser, our CDN and a back button may all cache\nit. Nothing here is per-visitor.","operationId":"support_instant_search_api_support_search_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":120,"default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":6,"minimum":1,"default":4,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Support Instant Search Api Support Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/support/attachments":{"post":{"tags":["support"],"summary":"Support Upload","description":"Accept one file as a raw body. Returns the card the widget renders.\n\nRaw bytes rather than multipart, deliberately: one file per request is the\nshape the widget uses anyway, the size cap can be applied while reading\ninstead of after parsing, and it keeps a form parser off the only\nunauthenticated surface in the product that takes bytes.","operationId":"support_upload_api_support_attachments_post","parameters":[{"name":"name","in":"query","required":false,"schema":{"type":"string","maxLength":240,"default":"","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Support Upload Api Support Attachments Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/support/attachments/{attachment_id}":{"get":{"tags":["support"],"summary":"Support Download","description":"Serve one file back to whoever holds a link we minted for it.\n\nA presigned link rather than a re-derived owner, and that is a decision\nrather than a shortcut: a download is a navigation, a navigation carries no\nheader, and the signed runtime handle is the only thing that identifies a\ncustomer of mcp.advisorppc.com here. The reasoning, and what bounds the\nlink instead, is in support_attachments.DOWNLOAD_TTL_S.\n\nEvery failure is the SAME 404. A 403 for \"wrong signature\" against a 404\nfor \"no such file\" would turn this route into an oracle for which ids\nexist.","operationId":"support_download_api_support_attachments__attachment_id__get","parameters":[{"name":"attachment_id","in":"path","required":true,"schema":{"type":"string","title":"Attachment Id"}},{"name":"o","in":"query","required":false,"schema":{"type":"string","default":"","title":"O"}},{"name":"e","in":"query","required":false,"schema":{"type":"string","default":"","title":"E"}},{"name":"t","in":"query","required":false,"schema":{"type":"string","default":"","title":"T"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Support Download Api Support Attachments  Attachment Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/support/voice/token":{"post":{"tags":["support"],"summary":"Support Voice Token","description":"Mint a short-lived xAI realtime token for the browser.\n\nThe browser opens the WebSocket itself (that is what makes this low-latency\nspeech-to-speech), so it needs a credential. It gets an EPHEMERAL one minted\nhere — never ``XAI_API_KEY``, which stays server-side and is read by name.\nThe response also carries the voice instructions, which are not secret and\nwhich the browser applies via ``session.update``.","operationId":"support_voice_token_api_support_voice_token_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Support Voice Token Api Support Voice Token Post"}}}}}}},"/api/support/chat":{"post":{"tags":["support"],"summary":"Support Chat","operationId":"support_chat_api_support_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportChatIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Support Chat Api Support Chat Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/support/phone/incoming":{"post":{"tags":["phone-support"],"summary":"Incoming Call","description":"Answer Twilio's voice webhook with streaming TwiML.\n\nOrder matters and is not negotiable: flag, then SIGNATURE, then anything\nelse. Nothing about the call is read, logged, or looked up before we know\nTwilio sent this.","operationId":"incoming_call_api_support_phone_incoming_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/phone-numbers":{"get":{"tags":["phone-support"],"summary":"List Numbers","operationId":"list_numbers_api_phone_numbers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Numbers Api Phone Numbers Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["phone-support"],"summary":"Add Number","description":"Add a number and send the first ownership code.\n\nAdmin, not member: a verified number is a credential for the whole account,\nso adding one is an administrative act even though it looks like a profile\nfield.","operationId":"add_number_api_phone_numbers_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Add Number Api Phone Numbers Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/phone-numbers/{number_id}/verify":{"post":{"tags":["phone-support"],"summary":"Verify Number","description":"Check the code and, only on 'approved', stamp ``verified_at``.","operationId":"verify_number_api_phone_numbers__number_id__verify_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"integer","title":"Number Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Verify Number Api Phone Numbers  Number Id  Verify Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/phone-numbers/{number_id}":{"delete":{"tags":["phone-support"],"summary":"Remove Number","operationId":"remove_number_api_phone_numbers__number_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"integer","title":"Number Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/credits/balance":{"get":{"tags":["credits"],"summary":"Balance","operationId":"balance_api_credits_balance_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/credits/checkout/{pack}":{"post":{"tags":["credits"],"summary":"Credit Pack Checkout","description":"Create hosted Checkout for one-time extra usage.","operationId":"credit_pack_checkout_api_credits_checkout__pack__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"pack","in":"path","required":true,"schema":{"type":"string","title":"Pack"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/credits/auto-topup":{"get":{"tags":["credits"],"summary":"Get Auto Topup","operationId":"get_auto_topup_api_credits_auto_topup_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopupOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["credits"],"summary":"Put Auto Topup","description":"Save the workspace's automatic top-up choice (admin or owner).","operationId":"put_auto_topup_api_credits_auto_topup_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopupIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopupOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/team":{"get":{"tags":["team"],"summary":"Get Team","operationId":"get_team_api_team_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/team/invites":{"post":{"tags":["team"],"summary":"Create Invite","operationId":"create_invite_api_team_invites_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteCreatedOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/team/invites/{invite_id}":{"delete":{"tags":["team"],"summary":"Revoke Invite","operationId":"revoke_invite_api_team_invites__invite_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/team/members/{user_id}":{"patch":{"tags":["team"],"summary":"Update Member","description":"Switch a teammate on or off, or change their role (member / admin).","operationId":"update_member_api_team_members__user_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberPatchIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["team"],"summary":"Remove Member","operationId":"remove_member_api_team_members__user_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/team/seats":{"put":{"tags":["team"],"summary":"Set Extra Seats","description":"Set how many extra seats the subscription carries.\n\nRaising adds seats to the live subscription and Stripe charges the\nprorated amount now. Lowering takes seats off and Stripe credits the\nunused time on the next invoice. Seats in use cannot be taken off.","operationId":"set_extra_seats_api_team_seats_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeatsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/team/invites/lookup":{"get":{"tags":["team"],"summary":"Lookup Invite","operationId":"lookup_invite_api_team_invites_lookup_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}},{"name":"app_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteLookupOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/team/invites/accept":{"post":{"tags":["team"],"summary":"Accept Invite","description":"Join the inviting workspace and make it this browser's workspace.","operationId":"accept_invite_api_team_invites_accept_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"app_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__team__WorkspaceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/team/workspaces":{"get":{"tags":["team"],"summary":"List Workspaces","operationId":"list_workspaces_api_team_workspaces_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__team__WorkspacesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/team/workspaces/{tenant_id}/switch":{"post":{"tags":["team"],"summary":"Switch Workspace","description":"Make ``tenant_id`` this browser's workspace. Active members only.","operationId":"switch_workspace_api_team_workspaces__tenant_id__switch_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"integer","title":"Tenant Id"}},{"name":"app_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__team__WorkspaceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/telegram/code":{"post":{"tags":["telegram-auth"],"summary":"Issue Pairing Code","operationId":"issue_pairing_code_api_auth_telegram_code_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairingCodeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Issue Pairing Code Api Auth Telegram Code Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/telegram/token":{"post":{"tags":["telegram-auth"],"summary":"Exchange Pairing Code","operationId":"exchange_pairing_code_api_auth_telegram_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramExchangeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Exchange Pairing Code Api Auth Telegram Token Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/telegram/session":{"post":{"tags":["telegram-auth"],"summary":"Resume Session","operationId":"resume_session_api_auth_telegram_session_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Resume Session Api Auth Telegram Session Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/telegram/me":{"get":{"tags":["telegram-auth"],"summary":"Telegram Me","operationId":"telegram_me_api_auth_telegram_me_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Telegram Me Api Auth Telegram Me Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/telegram/grants":{"get":{"tags":["telegram-auth"],"summary":"List Grants","operationId":"list_grants_api_auth_telegram_grants_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Grants Api Auth Telegram Grants Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/telegram/grants/{grant_id}":{"delete":{"tags":["telegram-auth"],"summary":"Revoke Grant","operationId":"revoke_grant_api_auth_telegram_grants__grant_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"grant_id","in":"path","required":true,"schema":{"type":"integer","title":"Grant Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mcp/servers":{"get":{"tags":["mcp-registry"],"summary":"List Custom Mcp Servers","operationId":"list_custom_mcp_servers_api_mcp_servers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomMCPServerListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["mcp-registry"],"summary":"Create Custom Mcp Server","operationId":"create_custom_mcp_server_api_mcp_servers_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomMCPServerCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomMCPServerOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mcp/servers/{server_id}":{"get":{"tags":["mcp-registry"],"summary":"Get Custom Mcp Server","operationId":"get_custom_mcp_server_api_mcp_servers__server_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"server_id","in":"path","required":true,"schema":{"type":"integer","title":"Server Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomMCPServerOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["mcp-registry"],"summary":"Update Custom Mcp Server","operationId":"update_custom_mcp_server_api_mcp_servers__server_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"server_id","in":"path","required":true,"schema":{"type":"integer","title":"Server Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomMCPServerPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomMCPServerOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["mcp-registry"],"summary":"Delete Custom Mcp Server","operationId":"delete_custom_mcp_server_api_mcp_servers__server_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"server_id","in":"path","required":true,"schema":{"type":"integer","title":"Server Id"}},{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp":{"get":{"tags":["mcp"],"summary":"Mcp Discovery","description":"Unauthenticated capability hint. Real method calls use POST /mcp.\n\nTODO(slice-21): publish ``.well-known/oauth-protected-resource`` (RFC 9728)\nand a ``401 WWW-Authenticate: Bearer resource_metadata=...`` challenge here\nonce the OAuth 2.1 + DCR flow is ported (founder-gated).","operationId":"mcp_discovery_mcp_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Mcp Discovery Mcp Get"}}}}}},"post":{"tags":["mcp"],"summary":"Mcp Rpc","description":"Single JSON-RPC entry point for ``initialize`` / ``tools/list`` /\n``tools/call``. Auth = the existing app_token Bearer, tenant-scoped via\n``current_tenant_ctx`` (deny-by-default). A malformed body returns a proper\nJSON-RPC parse/invalid-request error; a tool failure returns isError, never\na 500.","operationId":"mcp_rpc_mcp_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"X-Tenant-Id","in":"header","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/health":{"get":{"summary":"Healthz","operationId":"healthz_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Healthz Api Health Get"}}}}}}},"/healthz":{"get":{"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Healthz Healthz Get"}}}}}}},"/healthz/deep":{"get":{"summary":"Healthz Deep","operationId":"healthz_deep_healthz_deep_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AcceptIn":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"AcceptIn"},"AccountCardOut":{"properties":{"platform":{"type":"string","title":"Platform"},"platformLabel":{"type":"string","title":"Platformlabel"},"accountId":{"type":"string","title":"Accountid"},"accountName":{"type":"string","title":"Accountname"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"managed":{"type":"boolean","title":"Managed"}},"type":"object","required":["platform","platformLabel","accountId","accountName","managed"],"title":"AccountCardOut"},"AccountChatOpenIn":{"properties":{"accounts":{"items":{"$ref":"#/components/schemas/AccountRefIn"},"type":"array","maxItems":8,"minItems":1,"title":"Accounts"}},"additionalProperties":false,"type":"object","required":["accounts"],"title":"AccountChatOpenIn"},"AccountChatOpenOut":{"properties":{"conversationId":{"type":"string","title":"Conversationid"},"created":{"type":"boolean","title":"Created"},"accounts":{"items":{"$ref":"#/components/schemas/AccountCardOut"},"type":"array","title":"Accounts"},"activated":{"type":"boolean","title":"Activated","default":false},"notice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notice"},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previewtext"},"messageCount":{"type":"integer","title":"Messagecount","default":0}},"type":"object","required":["conversationId","created","accounts"],"title":"AccountChatOpenOut"},"AccountChatOut":{"properties":{"conversationId":{"type":"string","title":"Conversationid"},"previewText":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previewtext"},"lastMessageAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lastmessageat"},"messageCount":{"type":"integer","title":"Messagecount","default":0}},"type":"object","required":["conversationId"],"title":"AccountChatOut","description":"The account's own chat thread, as its card should render it."},"AccountDeletionIn":{"properties":{"confirmation":{"type":"string","maxLength":320,"minLength":3,"title":"Confirmation"}},"type":"object","required":["confirmation"],"title":"AccountDeletionIn"},"AccountDeletionOut":{"properties":{"deleted":{"type":"boolean","title":"Deleted"}},"type":"object","required":["deleted"],"title":"AccountDeletionOut"},"AccountMember":{"properties":{"userId":{"type":"string","title":"Userid"},"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"role":{"type":"string","title":"Role"},"isSuperuser":{"type":"boolean","title":"Issuperuser"}},"additionalProperties":false,"type":"object","required":["userId","email","role","isSuperuser"],"title":"AccountMember"},"AccountModels":{"properties":{"available":{"items":{"type":"string"},"type":"array","title":"Available"},"blocked":{"additionalProperties":{"type":"string"},"type":"object","title":"Blocked"}},"additionalProperties":false,"type":"object","required":["available","blocked"],"title":"AccountModels","description":"Which chat models this account can actually pick, and why not."},"AccountRefIn":{"properties":{"platform":{"type":"string","maxLength":50,"minLength":1,"title":"Platform"},"accountId":{"type":"string","maxLength":2048,"minLength":1,"title":"Accountid"}},"additionalProperties":false,"type":"object","required":["platform","accountId"],"title":"AccountRefIn"},"AccountsIn":{"properties":{"accounts":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Accounts"}},"type":"object","title":"AccountsIn","description":"``connector_slug -> account_id``.\n\nNull clears every override; an empty mapping does the same, so a client\ncan reset without having to send a null literal."},"AccountsOut":{"properties":{"id":{"type":"integer","title":"Id"},"accounts":{"additionalProperties":{"type":"string"},"type":"object","title":"Accounts"}},"type":"object","required":["id"],"title":"AccountsOut"},"AckOut":{"properties":{"id":{"type":"integer","title":"Id"},"status":{"type":"string","title":"Status"},"hold_cleared":{"type":"boolean","title":"Hold Cleared"}},"type":"object","required":["id","status","hold_cleared"],"title":"AckOut"},"ActionOut":{"properties":{"id":{"type":"integer","title":"Id"},"status":{"type":"string","title":"Status"},"result":{"additionalProperties":true,"type":"object","title":"Result","default":{}},"detail":{"type":"string","title":"Detail","default":""}},"type":"object","required":["id","status"],"title":"ActionOut"},"AdBudgetBurnImpactOut":{"properties":{"state":{"type":"string","enum":["available","unavailable"],"title":"State"},"selection_state":{"type":"string","enum":["bound","unavailable"],"title":"Selection State"},"aggregation_grain":{"type":"string","enum":["selected_provider_account_portfolio_utc_day","unavailable"],"title":"Aggregation Grain"},"additivity_state":{"type":"string","enum":["proven","unavailable"],"title":"Additivity State"},"additivity_proof":{"anyOf":[{"type":"string","const":"distinct_selected_provider_accounts"},{"type":"null"}],"title":"Additivity Proof"},"coverage_state":{"type":"string","enum":["complete","incomplete","ambiguous","unavailable"],"title":"Coverage State"},"expected_selection_count":{"anyOf":[{"type":"integer","maximum":9007199254740991.0,"minimum":0.0},{"type":"null"}],"title":"Expected Selection Count"},"observed_selection_count":{"anyOf":[{"type":"integer","maximum":9007199254740991.0,"minimum":0.0},{"type":"null"}],"title":"Observed Selection Count"},"headline_eligible":{"type":"boolean","title":"Headline Eligible"},"spent_minor":{"anyOf":[{"type":"integer","maximum":9007199254740991.0,"minimum":0.0},{"type":"null"}],"title":"Spent Minor"},"planned_budget_minor":{"anyOf":[{"type":"integer","maximum":9007199254740991.0,"minimum":0.0},{"type":"null"}],"title":"Planned Budget Minor"},"utilization_bps":{"anyOf":[{"type":"integer","maximum":9007199254740991.0,"minimum":0.0},{"type":"null"}],"title":"Utilization Bps"},"comparability_state":{"type":"string","enum":["proven","unavailable"],"title":"Comparability State"},"comparability_proof":{"anyOf":[{"type":"string","const":"same_tenant_provider_account_scope_utc_day_currency_exponent_planned_period"},{"type":"null"}],"title":"Comparability Proof"},"confidence":{"type":"string","enum":["high","medium","low","unavailable"],"title":"Confidence"},"basis":{"type":"string","const":"actual_ad_spend_observed","title":"Basis","default":"actual_ad_spend_observed"},"formula":{"type":"string","const":"sum(spent_minor); utilization_bps = round_half_up(spent_minor * 10000 / planned_budget_minor)","title":"Formula","default":"sum(spent_minor); utilization_bps = round_half_up(spent_minor * 10000 / planned_budget_minor)"},"exclusions":{"items":{"type":"string","enum":["missing_budgets","incompatible_scope_or_period","different_currencies","forecast_spend"]},"type":"array","title":"Exclusions"},"provenance":{"items":{"$ref":"#/components/schemas/ImpactProvenanceOut"},"type":"array","title":"Provenance"},"freshness":{"$ref":"#/components/schemas/ImpactFreshnessOut"}},"type":"object","required":["state","selection_state","aggregation_grain","additivity_state","additivity_proof","coverage_state","headline_eligible","spent_minor","planned_budget_minor","utilization_bps","comparability_state","comparability_proof","confidence","provenance","freshness"],"title":"AdBudgetBurnImpactOut"},"AddonIn":{"properties":{"quantity":{"type":"integer","title":"Quantity","default":1}},"type":"object","title":"AddonIn"},"AddonOut":{"properties":{"ok":{"type":"boolean","title":"Ok"},"kind":{"type":"string","title":"Kind"},"extra_accounts":{"type":"integer","title":"Extra Accounts"},"extra_seats":{"type":"integer","title":"Extra Seats"},"monthly_usd_each":{"type":"integer","title":"Monthly Usd Each"}},"type":"object","required":["ok","kind","extra_accounts","extra_seats","monthly_usd_each"],"title":"AddonOut"},"AdvisorModeIn":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"additionalProperties":false,"type":"object","required":["enabled"],"title":"AdvisorModeIn"},"AgentCardOut":{"properties":{"key":{"type":"string","title":"Key"},"name":{"type":"string","title":"Name"},"platform":{"type":"string","title":"Platform"},"description":{"type":"string","title":"Description"},"placement_lock":{"additionalProperties":true,"type":"object","title":"Placement Lock"},"read_tools":{"items":{"type":"string"},"type":"array","title":"Read Tools"},"write_tools":{"items":{"type":"string"},"type":"array","title":"Write Tools"},"writes_enabled":{"type":"boolean","title":"Writes Enabled"},"version":{"type":"integer","title":"Version"},"enabled":{"type":"boolean","title":"Enabled"},"instance":{"anyOf":[{"$ref":"#/components/schemas/AgentInstanceOut"},{"type":"null"}]},"last_run":{"anyOf":[{"$ref":"#/components/schemas/RunSummaryOut"},{"type":"null"}]},"pending_questions":{"type":"integer","title":"Pending Questions"},"is_custom":{"type":"boolean","title":"Is Custom","default":false},"status":{"type":"string","title":"Status","default":"active"}},"type":"object","required":["key","name","platform","description","placement_lock","read_tools","write_tools","writes_enabled","version","enabled","instance","last_run","pending_questions"],"title":"AgentCardOut","description":"One agent card = the global definition merged with this tenant's\ninstance state (enabled?, last run, pending-question count)."},"AgentDraft":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":2000,"title":"Description","default":""},"goal":{"type":"string","maxLength":1000,"title":"Goal","default":""},"system_prompt":{"type":"string","maxLength":20000,"minLength":1,"title":"System Prompt"},"tools":{"items":{"type":"string"},"type":"array","maxItems":64,"title":"Tools"},"model":{"type":"string","maxLength":80,"title":"Model","default":""},"effort":{"type":"string","maxLength":20,"title":"Effort","default":""}},"type":"object","required":["name","system_prompt"],"title":"AgentDraft","description":"The builder's structured output: a complete, validatable definition."},"AgentInstanceOut":{"properties":{"id":{"type":"integer","title":"Id"},"display_name":{"type":"string","title":"Display Name"},"status":{"type":"string","title":"Status"},"health":{"type":"string","title":"Health","default":"healthy"},"last_health_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Health Detail"},"accounts":{"additionalProperties":{"type":"string"},"type":"object","title":"Accounts"},"anomaly_hold":{"type":"boolean","title":"Anomaly Hold","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","display_name","status","created_at"],"title":"AgentInstanceOut","description":"This tenant's enabled instance of a definition (present only once the\ntenant has hit /enable)."},"AnomalyFlagOut":{"properties":{"id":{"type":"integer","title":"Id"},"provider":{"type":"string","title":"Provider"},"campaign_external_id":{"type":"string","title":"Campaign External Id"},"account_ref":{"type":"string","title":"Account Ref"},"account_label":{"type":"string","title":"Account Label"},"metric":{"type":"string","title":"Metric"},"day":{"type":"string","format":"date","title":"Day"},"observed":{"type":"number","title":"Observed"},"baseline_mean":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Baseline Mean"},"baseline_std":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Baseline Std"},"sigma":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sigma"},"direction":{"type":"string","title":"Direction"},"status":{"type":"string","title":"Status"},"alerted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Alerted At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","provider","campaign_external_id","account_ref","account_label","metric","day","observed","baseline_mean","baseline_std","sigma","direction","status","alerted_at","created_at"],"title":"AnomalyFlagOut"},"AnomalyListOut":{"properties":{"flags":{"items":{"$ref":"#/components/schemas/AnomalyFlagOut"},"type":"array","title":"Flags"}},"type":"object","required":["flags"],"title":"AnomalyListOut"},"AnswerOut":{"properties":{"id":{"type":"integer","title":"Id"},"status":{"type":"string","title":"Status"},"answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer"},"answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Answered At"}},"type":"object","required":["id","status","answer","answered_at"],"title":"AnswerOut","description":"Response after storing an answer — the question's new answered state."},"ApproveOut":{"properties":{"id":{"type":"integer","title":"Id"},"status":{"type":"string","title":"Status"},"approved_at":{"type":"string","format":"date-time","title":"Approved At"}},"type":"object","required":["id","status","approved_at"],"title":"ApproveOut"},"AttributedRevenueImpactOut":{"properties":{"state":{"type":"string","enum":["available","unavailable"],"title":"State"},"selection_state":{"type":"string","enum":["bound","unavailable"],"title":"Selection State"},"aggregation_grain":{"type":"string","enum":["selected_store_portfolio_utc_day","unavailable"],"title":"Aggregation Grain"},"additivity_state":{"type":"string","enum":["proven","unavailable"],"title":"Additivity State"},"additivity_proof":{"anyOf":[{"type":"string","const":"single_selected_store"},{"type":"null"}],"title":"Additivity Proof"},"coverage_state":{"type":"string","enum":["complete","incomplete","ambiguous","unavailable"],"title":"Coverage State"},"expected_selection_count":{"anyOf":[{"type":"integer","maximum":9007199254740991.0,"minimum":0.0},{"type":"null"}],"title":"Expected Selection Count"},"observed_selection_count":{"anyOf":[{"type":"integer","maximum":9007199254740991.0,"minimum":0.0},{"type":"null"}],"title":"Observed Selection Count"},"headline_eligible":{"type":"boolean","title":"Headline Eligible"},"amount_minor":{"anyOf":[{"type":"integer","maximum":9007199254740991.0,"minimum":0.0},{"type":"null"}],"title":"Amount Minor"},"confidence":{"type":"string","enum":["high","medium","low","unavailable"],"title":"Confidence"},"basis":{"type":"string","const":"gross_order_value_attributed","title":"Basis","default":"gross_order_value_attributed"},"formula":{"type":"string","const":"sum(attributed_revenue_minor)","title":"Formula","default":"sum(attributed_revenue_minor)"},"exclusions":{"items":{"type":"string","enum":["refunds","cost_of_goods","payment_and_platform_fees","ad_spend","operating_expenses"]},"type":"array","title":"Exclusions"},"provenance":{"items":{"$ref":"#/components/schemas/ImpactProvenanceOut"},"type":"array","title":"Provenance"},"freshness":{"$ref":"#/components/schemas/ImpactFreshnessOut"}},"type":"object","required":["state","selection_state","aggregation_grain","additivity_state","additivity_proof","coverage_state","headline_eligible","amount_minor","confidence","provenance","freshness"],"title":"AttributedRevenueImpactOut"},"AutoModelBiasIn":{"properties":{"bias":{"type":"string","maxLength":20,"title":"Bias"}},"type":"object","required":["bias"],"title":"AutoModelBiasIn","description":"Set how hard composer Auto may spend for the caller's workspace.\n\nValidated against the stored vocabulary rather than sanitized: a client\nsending an unknown value is stale or buggy, and silently storing \"economy\"\nfor a reader who asked for \"performance\" would look like the setting simply\ndid not save. The read path still sanitizes, because a hand-edited row must\nnot break chat."},"AutoModelBiasOut":{"properties":{"tenant_id":{"type":"integer","title":"Tenant Id"},"auto_model_bias":{"type":"string","title":"Auto Model Bias"}},"type":"object","required":["tenant_id","auto_model_bias"],"title":"AutoModelBiasOut"},"AutoTopupIn":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"pack":{"type":"string","title":"Pack","default":"100"},"monthly_limit":{"type":"integer","title":"Monthly Limit","default":2}},"type":"object","required":["enabled"],"title":"AutoTopupIn"},"AutoTopupOut":{"properties":{"available":{"type":"boolean","title":"Available"},"enabled":{"type":"boolean","title":"Enabled"},"pack":{"type":"string","title":"Pack"},"monthly_limit":{"type":"integer","title":"Monthly Limit"},"threshold_units":{"type":"integer","title":"Threshold Units"},"used_this_month":{"type":"integer","title":"Used This Month"},"paused_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paused Reason"},"monthly_limit_choices":{"items":{"type":"integer"},"type":"array","title":"Monthly Limit Choices"},"can_manage":{"type":"boolean","title":"Can Manage"},"card_on_file":{"type":"boolean","title":"Card On File"}},"type":"object","required":["available","enabled","pack","monthly_limit","threshold_units","used_this_month","paused_reason","monthly_limit_choices","can_manage","card_on_file"],"title":"AutoTopupOut"},"BalanceOut":{"properties":{"balance":{"type":"integer","title":"Balance"},"tier":{"type":"string","title":"Tier"},"weekly_usage_percent":{"type":"integer","title":"Weekly Usage Percent"},"resets_at":{"type":"string","title":"Resets At"},"included_available":{"type":"boolean","title":"Included Available"},"extra_usage_units":{"type":"integer","title":"Extra Usage Units"},"packs":{"items":{"$ref":"#/components/schemas/PackOut"},"type":"array","title":"Packs"},"purchase_channel":{"type":"string","title":"Purchase Channel"},"app_store_purchases_enabled":{"type":"boolean","title":"App Store Purchases Enabled"}},"type":"object","required":["balance","tier","weekly_usage_percent","resets_at","included_available","extra_usage_units","packs","purchase_channel","app_store_purchases_enabled"],"title":"BalanceOut"},"BrandProfileIn":{"properties":{"company_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Company Name"},"accent_hex":{"anyOf":[{"type":"string","maxLength":7},{"type":"null"}],"title":"Accent Hex"},"logo_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Logo Url"}},"type":"object","title":"BrandProfileIn"},"BuilderChatIn":{"properties":{"message":{"type":"string","maxLength":4000,"minLength":1,"title":"Message"},"builder_session_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Builder Session Id"}},"type":"object","required":["message"],"title":"BuilderChatIn"},"CampaignOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"spend":{"type":"number","title":"Spend"},"clicks":{"type":"integer","title":"Clicks"},"impressions":{"type":"integer","title":"Impressions"},"ctr":{"type":"number","title":"Ctr"},"cpc":{"type":"number","title":"Cpc"}},"type":"object","required":["id","name","status","spend","clicks","impressions","ctr","cpc"],"title":"CampaignOut"},"CampaignStatusOut":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","status"],"title":"CampaignStatusOut"},"CampaignsOut":{"properties":{"campaigns":{"items":{"$ref":"#/components/schemas/CampaignOut"},"type":"array","title":"Campaigns"}},"type":"object","required":["campaigns"],"title":"CampaignsOut"},"CancelIn":{"properties":{"confirm":{"type":"boolean","const":true,"title":"Confirm"}},"type":"object","required":["confirm"],"title":"CancelIn"},"CaseStudyOut":{"properties":{"id":{"type":"integer","title":"Id"},"brand":{"type":"string","title":"Brand"},"blurb":{"type":"string","title":"Blurb"},"stats":{"items":{"$ref":"#/components/schemas/StatOut"},"type":"array","title":"Stats"}},"type":"object","required":["id","brand","blurb","stats"],"title":"CaseStudyOut"},"ChatAgentRunListOut":{"properties":{"thread_id":{"type":"integer","title":"Thread Id"},"runs":{"items":{"$ref":"#/components/schemas/ChatAgentRunOut"},"type":"array","title":"Runs"}},"type":"object","required":["thread_id","runs"],"title":"ChatAgentRunListOut"},"ChatAgentRunOut":{"properties":{"id":{"type":"integer","title":"Id"},"thread_id":{"type":"integer","title":"Thread Id"},"instance_id":{"type":"integer","title":"Instance Id"},"definition_key":{"type":"string","title":"Definition Key"},"agent_name":{"type":"string","title":"Agent Name"},"display_name":{"type":"string","title":"Display Name"},"status":{"type":"string","title":"Status"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"}},"type":"object","required":["id","thread_id","instance_id","definition_key","agent_name","display_name","status","summary","error","created_at","updated_at","started_at","finished_at"],"title":"ChatAgentRunOut"},"ChatAttachmentErrorOut":{"properties":{"detail":{"type":"string","title":"Detail"}},"additionalProperties":false,"type":"object","required":["detail"],"title":"ChatAttachmentErrorOut"},"ChatAttachmentRefIn":{"properties":{"assetId":{"type":"string","maxLength":32,"minLength":32,"pattern":"^[0-9a-f]{32}$","title":"Assetid"}},"additionalProperties":false,"type":"object","required":["assetId"],"title":"ChatAttachmentRefIn","description":"Opaque reference only. File metadata is always loaded server-side."},"ChatAttachmentUploadIn":{"properties":{"fileName":{"type":"string","maxLength":255,"minLength":1,"title":"Filename"},"mimeType":{"type":"string","maxLength":100,"minLength":1,"title":"Mimetype"},"byteSize":{"type":"integer","maximum":10485760.0,"minimum":1.0,"title":"Bytesize"},"sha256":{"type":"string","maxLength":64,"minLength":64,"pattern":"^[0-9a-f]{64}$","title":"Sha256"}},"additionalProperties":false,"type":"object","required":["fileName","mimeType","byteSize","sha256"],"title":"ChatAttachmentUploadIn","description":"Future upload-initiation shape.\n\nThe endpoint is intentionally unavailable until durable object storage and\ncontent inspection are configured. ``sha256`` is only a client declaration;\na future ingestion worker must calculate and store the verified digest."},"ChatAttachmentUploadOut":{"properties":{"assetId":{"type":"string","maxLength":32,"minLength":32,"pattern":"^[0-9a-f]{32}$","title":"Assetid"}},"additionalProperties":false,"type":"object","required":["assetId"],"title":"ChatAttachmentUploadOut","description":"Reserved success shape for a future enabled upload-initiation rail."},"ChatGPTToolCall":{"properties":{"user_id":{"type":"integer","exclusiveMinimum":0.0,"title":"User Id"},"tenant_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Tenant Id"},"tool_name":{"type":"string","maxLength":128,"minLength":1,"title":"Tool Name"},"arguments":{"additionalProperties":true,"type":"object","title":"Arguments"}},"type":"object","required":["user_id","tenant_id","tool_name"],"title":"ChatGPTToolCall"},"ChatIn":{"properties":{"resumable":{"type":"boolean","title":"Resumable","default":false},"question_cards":{"type":"boolean","title":"Question Cards","default":false},"continuation":{"anyOf":[{"$ref":"#/components/schemas/app__chat_continuation__AnswerIn"},{"type":"null"}]},"messages":{"items":{"$ref":"#/components/schemas/ChatMessageIn"},"type":"array","maxItems":50,"minItems":1,"title":"Messages"},"attachments":{"items":{"$ref":"#/components/schemas/ChatAttachmentRefIn"},"type":"array","maxItems":5,"title":"Attachments"},"conversationId":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Conversationid"},"clientRequestId":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Clientrequestid"},"model":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Model"},"effort":{"anyOf":[{"type":"string","enum":["none","low","medium","high","xhigh","max"],"maxLength":16},{"type":"null"}],"title":"Effort"},"writeMode":{"type":"string","enum":["manual","accept","plan","auto"],"title":"Writemode","default":"manual"},"agentInstanceId":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Agentinstanceid"},"connector":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9-]{0,39}$"},{"type":"null"}],"title":"Connector"}},"additionalProperties":false,"type":"object","required":["messages"],"title":"ChatIn"},"ChatMessageIn":{"properties":{"role":{"type":"string","enum":["user","assistant"],"title":"Role"},"content":{"type":"string","maxLength":20000,"minLength":1,"title":"Content"}},"additionalProperties":false,"type":"object","required":["role","content"],"title":"ChatMessageIn"},"CheckoutOut":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"CheckoutOut"},"ConfigureIn":{"properties":{"instance_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Instance Id"},"thread_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Thread Id"},"goal":{"type":"string","maxLength":2000,"minLength":1,"title":"Goal"},"selected_scope":{"items":{"items":{"type":"string"},"type":"array"},"type":"array","maxItems":100,"minItems":1,"title":"Selected Scope"},"timezone":{"type":"string","maxLength":80,"title":"Timezone","default":"UTC"}},"type":"object","required":["instance_id","thread_id","goal","selected_scope"],"title":"ConfigureIn"},"ConfirmIn":{"properties":{"version":{"type":"integer","minimum":1.0,"title":"Version"},"scheduled":{"type":"boolean","title":"Scheduled","default":false},"notifications":{"type":"boolean","title":"Notifications","default":false}},"type":"object","required":["version"],"title":"ConfirmIn"},"ConfirmSiteIn":{"properties":{"site_url":{"type":"string","maxLength":500,"minLength":1,"title":"Site Url"},"confirm":{"type":"boolean","title":"Confirm","default":false}},"type":"object","required":["site_url"],"title":"ConfirmSiteIn"},"ConnectCredentials":{"properties":{"api_key":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Api Key"}},"type":"object","title":"ConnectCredentials"},"ConnectIn":{"properties":{"credentials":{"$ref":"#/components/schemas/ConnectCredentials","default":{}}},"type":"object","title":"ConnectIn"},"ConnectedAccountOut":{"properties":{"platform":{"type":"string","title":"Platform"},"accountId":{"type":"string","title":"Accountid"},"accountName":{"type":"string","title":"Accountname"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"}},"type":"object","required":["platform","accountId","accountName"],"title":"ConnectedAccountOut"},"ConnectedAccountsEnvelope":{"properties":{"all":{"items":{"$ref":"#/components/schemas/WorkspaceIntegrationOut"},"type":"array","title":"All"}},"type":"object","required":["all"],"title":"ConnectedAccountsEnvelope"},"ConnectorAccountOut":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"type":"string","title":"Account Name"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"is_managed":{"type":"boolean","title":"Is Managed","default":false},"is_default":{"type":"boolean","title":"Is Default","default":false}},"type":"object","required":["account_id","account_name"],"title":"ConnectorAccountOut"},"ConnectorConnectionOut":{"properties":{"service":{"type":"string","title":"Service"},"credential_id":{"type":"integer","title":"Credential Id"},"account_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Email"},"is_active":{"type":"boolean","title":"Is Active"},"connected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected At"}},"type":"object","required":["service","credential_id","is_active"],"title":"ConnectorConnectionOut"},"ConnectorDefaultAccountIn":{"properties":{"account_id":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Account Id"}},"type":"object","title":"ConnectorDefaultAccountIn"},"ConnectorDefaultAccountOut":{"properties":{"slug":{"type":"string","title":"Slug"},"default_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Account Id"},"status":{"type":"string","title":"Status","default":"updated"}},"type":"object","required":["slug"],"title":"ConnectorDefaultAccountOut"},"ConnectorManagedAccountsIn":{"properties":{"account_ids":{"items":{"type":"string"},"type":"array","maxItems":1000,"title":"Account Ids"},"default_account_id":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Default Account Id"}},"type":"object","title":"ConnectorManagedAccountsIn"},"ConnectorManagedAccountsOut":{"properties":{"slug":{"type":"string","title":"Slug"},"account_ids":{"items":{"type":"string"},"type":"array","title":"Account Ids"},"default_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Account Id"},"managed_account_count":{"type":"integer","title":"Managed Account Count"},"account_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Limit"},"remaining_account_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Remaining Account Count"},"status":{"type":"string","title":"Status","default":"updated"}},"type":"object","required":["slug","account_ids","managed_account_count","account_limit","remaining_account_count"],"title":"ConnectorManagedAccountsOut"},"ConnectorOut":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"category":{"type":"string","title":"Category"},"status":{"type":"string","title":"Status"},"mode":{"type":"string","title":"Mode","default":"api_key"},"granted_scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Granted Scopes"},"connected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Connected At"},"account_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Email"},"runtime_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runtime State"},"runtime_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runtime Detail"},"bridge_auto_connect":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Bridge Auto Connect"},"activation_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activation State"},"activation_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activation Detail"},"identity_inventory_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Identity Inventory State"},"selected_scope_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Scope State"},"account_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Account Count"},"accounts":{"anyOf":[{"items":{"$ref":"#/components/schemas/ConnectorAccountOut"},"type":"array"},{"type":"null"}],"title":"Accounts"},"connections":{"anyOf":[{"items":{"$ref":"#/components/schemas/ConnectorConnectionOut"},"type":"array"},{"type":"null"}],"title":"Connections"},"can_select_connection":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Can Select Connection"},"connect_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connect Url"},"requested_scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Requested Scopes"},"review_available":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Review Available"},"can_disconnect":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Can Disconnect"}},"type":"object","required":["slug","name","category","status"],"title":"ConnectorOut"},"ConnectorSelectionIn":{"properties":{"service":{"type":"string","maxLength":80,"minLength":1,"title":"Service"},"credential_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Credential Id"}},"type":"object","required":["service","credential_id"],"title":"ConnectorSelectionIn"},"ConnectorSelectionOut":{"properties":{"slug":{"type":"string","title":"Slug"},"service":{"type":"string","title":"Service"},"credential_id":{"type":"integer","title":"Credential Id"},"account_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Email"},"status":{"type":"string","title":"Status","default":"selected"}},"type":"object","required":["slug","service","credential_id"],"title":"ConnectorSelectionOut"},"ConnectorStatusOut":{"properties":{"slug":{"type":"string","title":"Slug"},"status":{"type":"string","title":"Status"}},"type":"object","required":["slug","status"],"title":"ConnectorStatusOut"},"CreateKeyIn":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","default":"Mobile app"}},"type":"object","title":"CreateKeyIn"},"CredentialStatusListOut":{"properties":{"credentials":{"items":{"$ref":"#/components/schemas/CredentialStatusOut"},"type":"array","title":"Credentials"},"max_age_days":{"type":"integer","title":"Max Age Days"}},"type":"object","required":["credentials","max_age_days"],"title":"CredentialStatusListOut"},"CredentialStatusOut":{"properties":{"slug":{"type":"string","title":"Slug"},"age_days":{"type":"integer","title":"Age Days"},"stale":{"type":"boolean","title":"Stale"}},"type":"object","required":["slug","age_days","stale"],"title":"CredentialStatusOut"},"CustomMCPServerCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"},"endpoint_url":{"type":"string","maxLength":2048,"minLength":1,"title":"Endpoint Url"},"transport":{"type":"string","enum":["streamable-http","sse"],"title":"Transport","default":"streamable-http"},"credentials":{"anyOf":[{"$ref":"#/components/schemas/MCPCredentialsIn"},{"type":"null"}]},"enabled":{"type":"boolean","title":"Enabled","default":true}},"additionalProperties":false,"type":"object","required":["name","endpoint_url"],"title":"CustomMCPServerCreate"},"CustomMCPServerListOut":{"properties":{"servers":{"items":{"$ref":"#/components/schemas/CustomMCPServerOut"},"type":"array","title":"Servers"}},"type":"object","required":["servers"],"title":"CustomMCPServerListOut"},"CustomMCPServerOut":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"endpoint_url":{"type":"string","title":"Endpoint Url"},"transport":{"type":"string","enum":["streamable-http","sse"],"title":"Transport"},"auth_type":{"type":"string","enum":["none","bearer","header"],"title":"Auth Type"},"auth_header_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Header Name"},"has_credentials":{"type":"boolean","title":"Has Credentials"},"enabled":{"type":"boolean","title":"Enabled"},"credentials_updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Credentials Updated At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","description","endpoint_url","transport","auth_type","auth_header_name","has_credentials","enabled","credentials_updated_at","created_at","updated_at"],"title":"CustomMCPServerOut"},"CustomMCPServerPatch":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"},"endpoint_url":{"anyOf":[{"type":"string","maxLength":2048,"minLength":1},{"type":"null"}],"title":"Endpoint Url"},"transport":{"anyOf":[{"type":"string","enum":["streamable-http","sse"]},{"type":"null"}],"title":"Transport"},"credentials":{"anyOf":[{"$ref":"#/components/schemas/MCPCredentialsIn"},{"type":"null"}]},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"additionalProperties":false,"type":"object","title":"CustomMCPServerPatch"},"DailyBusinessImpactOut":{"properties":{"day":{"type":"string","format":"date","title":"Day"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"state":{"type":"string","enum":["available","partial","unavailable"],"title":"State"},"impacts":{"items":{"$ref":"#/components/schemas/DailyCurrencyImpactOut"},"type":"array","title":"Impacts"},"connector_action":{"anyOf":[{"type":"string","enum":["connect","reconnect"]},{"type":"null"}],"title":"Connector Action"},"connectors_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connectors Url"}},"type":"object","required":["day","generated_at","state","impacts"],"title":"DailyBusinessImpactOut"},"DailyCurrencyImpactOut":{"properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$","title":"Currency"},"currency_exponent":{"type":"integer","maximum":3.0,"minimum":0.0,"title":"Currency Exponent"},"attributed_revenue":{"$ref":"#/components/schemas/AttributedRevenueImpactOut"},"verified_ad_savings":{"$ref":"#/components/schemas/VerifiedAdSavingsImpactOut"},"ad_budget_burn":{"$ref":"#/components/schemas/AdBudgetBurnImpactOut"}},"type":"object","required":["currency","currency_exponent","attributed_revenue","verified_ad_savings","ad_budget_burn"],"title":"DailyCurrencyImpactOut"},"EmailGrantIn":{"properties":{"tier":{"type":"string","enum":["free","pro","google","gm","gmt","max","agency","team","enterprise"],"title":"Tier"},"status":{"type":"string","enum":["active","inactive","canceled"],"title":"Status","default":"active"},"reason":{"type":"string","maxLength":500,"minLength":3,"title":"Reason"},"email":{"type":"string","maxLength":320,"minLength":3,"title":"Email"},"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name"},"welcome":{"type":"boolean","title":"Welcome","default":true}},"additionalProperties":false,"type":"object","required":["tier","reason","email"],"title":"EmailGrantIn","description":"A plan grant addressed to an e-mail rather than a tenant id.\n\nThe address may have no site account yet: the route creates a password-less\nuser (Sign in with Google links by e-mail; forgot-password sets a password),\ntheir personal tenant, and the manual entitlement in one audited step.\n``name`` is used only when the user is created."},"EmailGrantOut":{"properties":{"tenantId":{"type":"string","title":"Tenantid"},"name":{"type":"string","title":"Name"},"tier":{"type":"string","title":"Tier"},"status":{"type":"string","title":"Status"},"billingSource":{"type":"string","title":"Billingsource"},"members":{"type":"integer","title":"Members"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updatedat"},"editable":{"type":"boolean","title":"Editable"},"email":{"type":"string","title":"Email"},"userId":{"type":"string","title":"Userid"},"userCreated":{"type":"boolean","title":"Usercreated"},"tenantCreated":{"type":"boolean","title":"Tenantcreated"},"changed":{"type":"boolean","title":"Changed"},"welcomed":{"type":"boolean","title":"Welcomed","default":false}},"additionalProperties":false,"type":"object","required":["tenantId","name","tier","status","billingSource","members","editable","email","userId","userCreated","tenantCreated","changed"],"title":"EmailGrantOut","description":"The granted tenant's plan row plus what the call had to create."},"EnableIn":{"properties":{},"type":"object","title":"EnableIn","description":"Body for /enable. Deliberately EMPTY, and kept as a type rather than\ndeleted so an older client still POSTs successfully: a stale build sending\n``{\"model\": …}`` is accepted and its model ignored, never 422'd."},"EngineMode":{"properties":{"advisor_enabled_chat":{"type":"boolean","title":"Advisor Enabled Chat"},"advisor_enabled_runner":{"type":"boolean","title":"Advisor Enabled Runner"}},"additionalProperties":false,"type":"object","required":["advisor_enabled_chat","advisor_enabled_runner"],"title":"EngineMode","description":"Current advisor-format posture for both engine call sites."},"EngineModePatch":{"properties":{"advisor_enabled_chat":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Advisor Enabled Chat"},"advisor_enabled_runner":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Advisor Enabled Runner"}},"additionalProperties":false,"type":"object","title":"EngineModePatch","description":"Partial toggle — omit a field to leave that call site unchanged.\n\nReject unknown keys so a typo (e.g. ``advisor_enabled_char``) is a 422, not a\nsilent no-op that leaves an operator believing the mode flipped."},"ExecuteOut":{"properties":{"id":{"type":"integer","title":"Id"},"status":{"type":"string","title":"Status"},"executed_action_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Executed Action Id"},"result":{"additionalProperties":true,"type":"object","title":"Result"}},"type":"object","required":["id","status","executed_action_id","result"],"title":"ExecuteOut"},"ExecutedActionListOut":{"properties":{"executed_actions":{"items":{"$ref":"#/components/schemas/ExecutedActionOut"},"type":"array","title":"Executed Actions"}},"type":"object","required":["executed_actions"],"title":"ExecutedActionListOut"},"ExecutedActionOut":{"properties":{"id":{"type":"integer","title":"Id"},"recommendation_id":{"type":"integer","title":"Recommendation Id"},"account_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Ref"},"account_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Label"},"tool":{"type":"string","title":"Tool"},"args_json":{"additionalProperties":true,"type":"object","title":"Args Json"},"result_json":{"additionalProperties":true,"type":"object","title":"Result Json"},"rollback_tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rollback Tool"},"rollback_args_json":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rollback Args Json"},"status":{"type":"string","title":"Status"},"executed_at":{"type":"string","format":"date-time","title":"Executed At"},"rolled_back_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Rolled Back At"}},"type":"object","required":["id","recommendation_id","account_ref","account_label","tool","args_json","result_json","rollback_tool","rollback_args_json","status","executed_at","rolled_back_at"],"title":"ExecutedActionOut"},"FaqOut":{"properties":{"id":{"type":"integer","title":"Id"},"question":{"type":"string","title":"Question"},"answer":{"type":"string","title":"Answer"}},"type":"object","required":["id","question","answer"],"title":"FaqOut"},"GoalDeleteOut":{"properties":{"id":{"type":"integer","title":"Id"},"deleted":{"type":"boolean","title":"Deleted"}},"type":"object","required":["id","deleted"],"title":"GoalDeleteOut"},"GoalIn":{"properties":{"type":{"type":"string","title":"Type"},"target_value":{"type":"number","exclusiveMinimum":0.0,"title":"Target Value"},"budget_ceiling_cents":{"type":"integer","minimum":0.0,"title":"Budget Ceiling Cents","default":0},"deadline":{"type":"string","format":"date","title":"Deadline"},"status":{"type":"string","title":"Status","default":"active"},"currency":{"type":"string","title":"Currency","default":"USD"},"composite_json":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Composite Json"},"channel_mix_json":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Channel Mix Json"},"attribution_mode":{"type":"string","title":"Attribution Mode","default":"ga4_blend"}},"type":"object","required":["type","target_value","deadline"],"title":"GoalIn"},"GoalListOut":{"properties":{"goals":{"items":{"$ref":"#/components/schemas/GoalOut"},"type":"array","title":"Goals"}},"type":"object","required":["goals"],"title":"GoalListOut"},"GoalOut":{"properties":{"id":{"type":"integer","title":"Id"},"type":{"type":"string","title":"Type"},"target_value":{"type":"number","title":"Target Value"},"budget_ceiling_cents":{"type":"integer","title":"Budget Ceiling Cents"},"spent_cents":{"type":"integer","title":"Spent Cents"},"currency":{"type":"string","title":"Currency"},"deadline":{"type":"string","format":"date","title":"Deadline"},"status":{"type":"string","title":"Status"},"attribution_mode":{"type":"string","title":"Attribution Mode"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","type","target_value","budget_ceiling_cents","spent_cents","currency","deadline","status","attribution_mode","created_at","updated_at"],"title":"GoalOut"},"GoalPatch":{"properties":{"target_value":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Target Value"},"budget_ceiling_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Budget Ceiling Cents"},"deadline":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Deadline"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"channel_mix_json":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Channel Mix Json"}},"type":"object","title":"GoalPatch"},"GoogleExchangeIn":{"properties":{"code":{"type":"string","maxLength":2048,"minLength":10,"title":"Code"}},"type":"object","required":["code"],"title":"GoogleExchangeIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImpactFreshnessOut":{"properties":{"state":{"type":"string","enum":["fresh","stale","unavailable"],"title":"State"},"as_of":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"As Of"},"max_age_seconds":{"type":"integer","const":86400,"title":"Max Age Seconds","default":86400}},"type":"object","required":["state","as_of"],"title":"ImpactFreshnessOut"},"ImpactProvenanceOut":{"properties":{"source_system":{"type":"string","minLength":1,"pattern":".*\\S.*","title":"Source System"},"record_count":{"type":"integer","maximum":9007199254740991.0,"minimum":1.0,"title":"Record Count"},"latest_source_observed_at":{"type":"string","format":"date-time","title":"Latest Source Observed At"},"latest_ingested_at":{"type":"string","format":"date-time","title":"Latest Ingested At"}},"type":"object","required":["source_system","record_count","latest_source_observed_at","latest_ingested_at"],"title":"ImpactProvenanceOut"},"InsightsBenchmarkOut":{"properties":{"basis":{"type":"string","title":"Basis"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"source":{"type":"string","title":"Source","default":""},"detail":{"type":"string","title":"Detail","default":""}},"type":"object","required":["basis"],"title":"InsightsBenchmarkOut","description":"The yardstick every platform verdict was measured against."},"InsightsLiveOut":{"properties":{"polled_at":{"type":"string","format":"date-time","title":"Polled At"},"refresh_seconds":{"type":"integer","title":"Refresh Seconds","default":60},"reporting":{"$ref":"#/components/schemas/InsightsReportingOut"},"ad_spend":{"$ref":"#/components/schemas/LiveAdSpendOut"},"traffic":{"$ref":"#/components/schemas/LiveTrafficOut"},"approvals":{"$ref":"#/components/schemas/LiveApprovalsOut"},"conversions":{"$ref":"#/components/schemas/LiveConversionsOut"}},"type":"object","required":["polled_at","reporting","ad_spend","traffic","approvals","conversions"],"title":"InsightsLiveOut"},"InsightsReportingOut":{"properties":{"state":{"type":"string","title":"State"},"managed_account_count":{"type":"integer","title":"Managed Account Count"},"detail":{"type":"string","title":"Detail"},"connectors_url":{"type":"string","title":"Connectors Url"},"since":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"},"until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Until"},"observed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Observed At"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"}},"type":"object","required":["state","managed_account_count","detail","connectors_url"],"title":"InsightsReportingOut","description":"Why the summary is empty or zero — never a substitute for numbers."},"InsightsSummaryOut":{"properties":{"kpis":{"items":{"$ref":"#/components/schemas/KpiOut"},"type":"array","title":"Kpis"},"spendTrend":{"items":{"$ref":"#/components/schemas/SpendPointOut"},"type":"array","title":"Spendtrend"},"byPlatform":{"items":{"$ref":"#/components/schemas/PlatformRowOut"},"type":"array","title":"Byplatform"},"reporting":{"anyOf":[{"$ref":"#/components/schemas/InsightsReportingOut"},{"type":"null"}]},"benchmark":{"anyOf":[{"$ref":"#/components/schemas/InsightsBenchmarkOut"},{"type":"null"}]}},"type":"object","required":["kpis","spendTrend","byPlatform"],"title":"InsightsSummaryOut"},"InstanceStatusIn":{"properties":{"status":{"type":"string","enum":["active","paused"],"title":"Status"}},"type":"object","required":["status"],"title":"InstanceStatusIn","description":"Pause/resume the real manager instance used by the daily scheduler."},"InviteCreatedOut":{"properties":{"invite":{"$ref":"#/components/schemas/InviteOut"},"invite_link":{"type":"string","title":"Invite Link"},"email_sent":{"type":"boolean","title":"Email Sent"},"team":{"$ref":"#/components/schemas/TeamOut"}},"type":"object","required":["invite","invite_link","email_sent","team"],"title":"InviteCreatedOut"},"InviteIn":{"properties":{"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role","default":"member"}},"type":"object","required":["email"],"title":"InviteIn"},"InviteLookupOut":{"properties":{"workspace_name":{"type":"string","title":"Workspace Name"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"email_matches":{"type":"boolean","title":"Email Matches"},"problem":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Problem"}},"type":"object","required":["workspace_name","email","role","email_matches","problem"],"title":"InviteLookupOut"},"InviteOut":{"properties":{"id":{"type":"integer","title":"Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["id","email","role","created_at","expires_at"],"title":"InviteOut"},"KeywordIdeasIn":{"properties":{"seeds":{"items":{"type":"string"},"type":"array","maxItems":20,"minItems":1,"title":"Seeds"},"geo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geo"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"}},"type":"object","required":["seeds"],"title":"KeywordIdeasIn"},"KnowledgeResultOut":{"properties":{"title":{"type":"string","title":"Title"},"source":{"type":"string","title":"Source"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"content":{"type":"string","title":"Content"},"score":{"type":"number","title":"Score"},"library":{"type":"string","title":"Library"}},"type":"object","required":["title","source","content","score","library"],"title":"KnowledgeResultOut"},"KnowledgeSearchOut":{"properties":{"results":{"items":{"$ref":"#/components/schemas/KnowledgeResultOut"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"KnowledgeSearchOut"},"KpiOut":{"properties":{"label":{"type":"string","title":"Label"},"value":{"type":"string","title":"Value"},"delta":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delta"}},"type":"object","required":["label","value"],"title":"KpiOut"},"LeadIn":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"company":{"type":"string","maxLength":200,"minLength":1,"title":"Company"},"monthly_spend":{"type":"string","maxLength":50,"minLength":1,"title":"Monthly Spend"},"message":{"type":"string","maxLength":5000,"title":"Message","default":""}},"type":"object","required":["name","email","company","monthly_spend"],"title":"LeadIn"},"LeadOut":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"company":{"type":"string","maxLength":200,"minLength":1,"title":"Company"},"monthly_spend":{"type":"string","maxLength":50,"minLength":1,"title":"Monthly Spend"},"message":{"type":"string","maxLength":5000,"title":"Message","default":""},"id":{"type":"integer","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["name","email","company","monthly_spend","id","created_at"],"title":"LeadOut"},"LiveAdSpendOut":{"properties":{"state":{"type":"string","title":"State"},"detail":{"type":"string","title":"Detail","default":""},"as_of":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"As Of"},"through":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Through"},"cycle_label":{"type":"string","title":"Cycle Label","default":""},"cycle_spend":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cycle Spend"},"previous_cycle_spend":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Previous Cycle Spend"},"delta":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delta"},"trend":{"items":{"$ref":"#/components/schemas/SpendPointOut"},"type":"array","title":"Trend"},"platforms":{"items":{"$ref":"#/components/schemas/LivePlatformSpendOut"},"type":"array","title":"Platforms"}},"type":"object","required":["state"],"title":"LiveAdSpendOut"},"LiveApprovalItemOut":{"properties":{"id":{"type":"integer","title":"Id"},"title":{"type":"string","title":"Title"},"playbook_key":{"type":"string","title":"Playbook Key"},"account_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Label"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","title","playbook_key","created_at"],"title":"LiveApprovalItemOut"},"LiveApprovalsOut":{"properties":{"state":{"type":"string","title":"State"},"detail":{"type":"string","title":"Detail","default":""},"as_of":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"As Of"},"through":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Through"},"count":{"type":"integer","title":"Count","default":0},"items":{"items":{"$ref":"#/components/schemas/LiveApprovalItemOut"},"type":"array","title":"Items"},"href":{"type":"string","title":"Href","default":"/app/optimization"}},"type":"object","required":["state"],"title":"LiveApprovalsOut"},"LiveConversionsOut":{"properties":{"state":{"type":"string","title":"State"},"detail":{"type":"string","title":"Detail","default":""},"as_of":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"As Of"},"through":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Through"},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Conversions"},"revenue":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Revenue"},"roas":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Roas"},"tracks_revenue":{"type":"boolean","title":"Tracks Revenue","default":false},"conversions_delta":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversions Delta"},"revenue_delta":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revenue Delta"}},"type":"object","required":["state"],"title":"LiveConversionsOut"},"LivePlatformSpendOut":{"properties":{"platform":{"type":"string","title":"Platform"},"spend":{"type":"number","title":"Spend"}},"type":"object","required":["platform","spend"],"title":"LivePlatformSpendOut"},"LiveTrafficOut":{"properties":{"state":{"type":"string","title":"State"},"detail":{"type":"string","title":"Detail","default":""},"as_of":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"As Of"},"through":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Through"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"unit":{"type":"string","title":"Unit","default":"sessions"},"window_days":{"type":"integer","title":"Window Days","default":7},"paid":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Paid"},"organic":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Organic"},"other":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Other"},"paid_share":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Paid Share"}},"type":"object","required":["state"],"title":"LiveTrafficOut"},"LoginEmailIn":{"properties":{"email":{"type":"string","maxLength":320,"minLength":3,"title":"Email"}},"type":"object","required":["email"],"title":"LoginEmailIn"},"LoginEmailOut":{"properties":{"id":{"type":"integer","title":"Id"},"email":{"type":"string","title":"Email"},"verified":{"type":"boolean","title":"Verified"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","email","verified"],"title":"LoginEmailOut"},"LoginEmailsOut":{"properties":{"primary":{"type":"string","title":"Primary"},"emails":{"items":{"$ref":"#/components/schemas/LoginEmailOut"},"type":"array","title":"Emails"},"max_additional":{"type":"integer","title":"Max Additional"}},"type":"object","required":["primary","emails","max_additional"],"title":"LoginEmailsOut"},"LoginIn":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":200,"minLength":1,"title":"Password"}},"type":"object","required":["email","password"],"title":"LoginIn"},"MCPCredentialsIn":{"properties":{"type":{"type":"string","enum":["bearer","header"],"title":"Type"},"secret":{"type":"string","format":"password","title":"Secret","writeOnly":true},"header_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Header Name"}},"additionalProperties":false,"type":"object","required":["type","secret"],"title":"MCPCredentialsIn"},"ManagedChatIn":{"properties":{"message":{"type":"string","maxLength":20000,"minLength":1,"title":"Message"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"}},"type":"object","required":["message"],"title":"ManagedChatIn"},"ManagedChatOut":{"properties":{"session_id":{"type":"string","title":"Session Id"},"reply":{"type":"string","title":"Reply"}},"type":"object","required":["session_id","reply"],"title":"ManagedChatOut"},"McpAppCallIn":{"properties":{"conversationId":{"type":"integer","exclusiveMinimum":0.0,"title":"Conversationid"},"server":{"type":"string","maxLength":40,"minLength":1,"title":"Server"},"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name"},"arguments":{"additionalProperties":true,"type":"object","title":"Arguments"}},"type":"object","required":["conversationId","server","name"],"title":"McpAppCallIn"},"McpAppResourceIn":{"properties":{"conversationId":{"type":"integer","exclusiveMinimum":0.0,"title":"Conversationid"},"server":{"type":"string","maxLength":40,"minLength":1,"title":"Server"},"uri":{"type":"string","maxLength":200,"minLength":1,"title":"Uri"}},"type":"object","required":["conversationId","server","uri"],"title":"McpAppResourceIn"},"MemberOut":{"properties":{"user_id":{"type":"integer","title":"User Id"},"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"is_you":{"type":"boolean","title":"Is You"},"joined_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Joined At"}},"type":"object","required":["user_id","email","name","role","status","is_you","joined_at"],"title":"MemberOut"},"MemberPatchIn":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"}},"type":"object","title":"MemberPatchIn"},"MobileChatIn":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/ChatMessageIn"},"type":"array","maxItems":50,"minItems":1,"title":"Messages"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},"type":"object","required":["messages"],"title":"MobileChatIn"},"OAuthStartOut":{"properties":{"authorize_url":{"type":"string","title":"Authorize Url"}},"type":"object","required":["authorize_url"],"title":"OAuthStartOut"},"PackOut":{"properties":{"pack":{"type":"string","title":"Pack"},"usd_cents":{"type":"integer","title":"Usd Cents"},"credits":{"type":"integer","title":"Credits"},"label":{"type":"string","title":"Label"}},"type":"object","required":["pack","usd_cents","credits","label"],"title":"PackOut"},"PairingCodeRequest":{"properties":{"user_initiated":{"type":"boolean","const":true,"title":"User Initiated"}},"additionalProperties":false,"type":"object","required":["user_initiated"],"title":"PairingCodeRequest"},"PasswordForgotIn":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"PasswordForgotIn"},"PasswordForgotOut":{"properties":{"sent":{"type":"boolean","title":"Sent","default":true}},"type":"object","title":"PasswordForgotOut","description":"Deliberately contentless.\n\nThe same body is returned whether or not the address belongs to an account,\nso the endpoint cannot be used to enumerate customers."},"PasswordResetIn":{"properties":{"token":{"type":"string","maxLength":200,"minLength":16,"title":"Token"},"password":{"type":"string","maxLength":200,"minLength":8,"title":"Password"}},"type":"object","required":["token","password"],"title":"PasswordResetIn"},"PasswordResetOut":{"properties":{"reset":{"type":"boolean","title":"Reset","default":true}},"type":"object","title":"PasswordResetOut"},"PauseIn":{"properties":{"confirm":{"type":"boolean","const":true,"title":"Confirm"},"months":{"type":"integer","enum":[1,2],"title":"Months"}},"type":"object","required":["confirm","months"],"title":"PauseIn"},"PhoneNumberIn":{"properties":{"number":{"type":"string","maxLength":32,"title":"Number"},"label":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Label"},"channel":{"type":"string","maxLength":10,"title":"Channel","default":"sms"}},"type":"object","required":["number"],"title":"PhoneNumberIn"},"PlanGrantIn":{"properties":{"tier":{"type":"string","enum":["free","pro","google","gm","gmt","max","agency","team","enterprise"],"title":"Tier"},"status":{"type":"string","enum":["active","inactive","canceled"],"title":"Status","default":"active"},"reason":{"type":"string","maxLength":500,"minLength":3,"title":"Reason"}},"additionalProperties":false,"type":"object","required":["tier","reason"],"title":"PlanGrantIn","description":"A deliberate, attributed plan change. ``reason`` is not optional."},"PlatformRowOut":{"properties":{"platform":{"type":"string","title":"Platform"},"spend":{"type":"number","title":"Spend"},"clicks":{"type":"integer","title":"Clicks"},"impressions":{"type":"integer","title":"Impressions"},"conversions":{"type":"number","title":"Conversions"},"revenue":{"type":"number","title":"Revenue","default":0.0},"roas":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Roas"},"cpa":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cpa"},"ctr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ctr"},"convRate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Convrate"},"spendShare":{"type":"number","title":"Spendshare","default":0.0},"spendDelta":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Spenddelta"},"revenueDelta":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revenuedelta"},"verdict":{"type":"string","title":"Verdict","default":"insufficient_signal"},"verdictLabel":{"type":"string","title":"Verdictlabel","default":"No signal"},"verdictDetail":{"type":"string","title":"Verdictdetail","default":""}},"type":"object","required":["platform","spend","clicks","impressions","conversions"],"title":"PlatformRowOut","description":"One platform's 30-day totals, plus the derived metrics Overview ranks on.\n\nEverything here is computed from receipted ``campaign_metric_daily`` rows.\nA derived metric whose denominator is zero is ``None``, never 0 — a\nplatform with no revenue has an unknown ROAS, not a ROAS of zero."},"PlaybookRunOut":{"properties":{"playbook":{"type":"string","title":"Playbook"},"staged":{"type":"integer","title":"Staged"}},"type":"object","required":["playbook","staged"],"title":"PlaybookRunOut"},"PortalOut":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"PortalOut"},"PrefsIn":{"properties":{"model":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Model"},"effort":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Effort"}},"type":"object","title":"PrefsIn","description":"Every field tri-state: absent = keep, null = clear, value = set."},"PrefsOut":{"properties":{"id":{"type":"integer","title":"Id"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effort"}},"type":"object","required":["id","model","effort"],"title":"PrefsOut"},"PrimaryEmailOut":{"properties":{"primary":{"type":"string","title":"Primary"}},"type":"object","required":["primary"],"title":"PrimaryEmailOut"},"QuestionOut":{"properties":{"id":{"type":"integer","title":"Id"},"question":{"type":"string","title":"Question"},"options":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Options"},"status":{"type":"string","title":"Status"},"answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Answered At"}},"type":"object","required":["id","question","options","status","answer","created_at","answered_at"],"title":"QuestionOut","description":"A blocking question a run raised (status ``pending`` until the tenant\nanswers it via POST /questions/{id}/answer)."},"RecTypeResetOut":{"properties":{"rec_type":{"type":"string","title":"Rec Type"},"gating":{"type":"string","title":"Gating"},"confidence":{"type":"number","title":"Confidence"}},"type":"object","required":["rec_type","gating","confidence"],"title":"RecTypeResetOut"},"RecommendationListOut":{"properties":{"recommendations":{"items":{"$ref":"#/components/schemas/RecommendationOut"},"type":"array","title":"Recommendations"},"writes_enabled":{"type":"boolean","title":"Writes Enabled","default":false}},"type":"object","required":["recommendations"],"title":"RecommendationListOut"},"RecommendationOut":{"properties":{"id":{"type":"integer","title":"Id"},"instance_id":{"type":"integer","title":"Instance Id"},"playbook_key":{"type":"string","title":"Playbook Key"},"rec_type":{"type":"string","title":"Rec Type"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"campaign_external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign External Id"},"account_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Ref"},"account_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Label"},"title":{"type":"string","title":"Title"},"body_json":{"additionalProperties":true,"type":"object","title":"Body Json"},"predicted_effect_json":{"additionalProperties":true,"type":"object","title":"Predicted Effect Json"},"confidence":{"type":"number","title":"Confidence"},"guardrail_json":{"additionalProperties":true,"type":"object","title":"Guardrail Json"},"rollback_json":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rollback Json"},"scenario":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scenario"},"status":{"type":"string","title":"Status"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","instance_id","playbook_key","rec_type","provider","campaign_external_id","account_ref","account_label","title","body_json","predicted_effect_json","confidence","guardrail_json","rollback_json","scenario","status","expires_at","created_at"],"title":"RecommendationOut"},"RefreshRequestIn":{"properties":{"scope_revision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope Revision"}},"type":"object","title":"RefreshRequestIn","description":"Optional body of POST /api/insights/refresh.\n\n``scope_revision`` is the scope the client is DISPLAYING; a mismatch means\nthe selection changed under it and is answered 409 rather than queueing\nwork for a scope the user is no longer looking at."},"RegisterIn":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":200,"minLength":8,"title":"Password"},"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name"},"signup_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signup From"},"signup_touch":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signup Touch"}},"type":"object","required":["email","password"],"title":"RegisterIn"},"RejectOut":{"properties":{"id":{"type":"integer","title":"Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","status"],"title":"RejectOut"},"ReportIn":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"sections":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sections"}},"type":"object","title":"ReportIn"},"ReportingActivityRequestIn":{"properties":{"scope_revision":{"type":"string","maxLength":256,"minLength":1,"title":"Scope Revision"}},"additionalProperties":false,"type":"object","required":["scope_revision"],"title":"ReportingActivityRequestIn","description":"Only the displayed revision is client input; policy and time are server-owned."},"ReportingCampaignOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"spend":{"type":"number","title":"Spend"},"clicks":{"type":"integer","title":"Clicks"},"impressions":{"type":"integer","title":"Impressions"},"ctr":{"type":"number","title":"Ctr"},"cpc":{"type":"number","title":"Cpc"},"accountId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accountid"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"reportOnly":{"type":"boolean","title":"Reportonly","default":true}},"type":"object","required":["id","name","status","spend","clicks","impressions","ctr","cpc"],"title":"ReportingCampaignOut"},"ReportingCampaignsOut":{"properties":{"campaigns":{"items":{"$ref":"#/components/schemas/ReportingCampaignOut"},"type":"array","title":"Campaigns"}},"type":"object","required":["campaigns"],"title":"ReportingCampaignsOut"},"ResumeIn":{"properties":{"confirm":{"type":"boolean","const":true,"title":"Confirm"}},"type":"object","required":["confirm"],"title":"ResumeIn"},"ReviewStartOut":{"properties":{"review_url":{"type":"string","title":"Review Url"}},"type":"object","required":["review_url"],"title":"ReviewStartOut"},"RollbackOut":{"properties":{"id":{"type":"integer","title":"Id"},"status":{"type":"string","title":"Status"},"recommendation_id":{"type":"integer","title":"Recommendation Id"}},"type":"object","required":["id","status","recommendation_id"],"title":"RollbackOut"},"RotateIn":{"properties":{"credentials":{"$ref":"#/components/schemas/ConnectCredentials","default":{}}},"type":"object","title":"RotateIn"},"RotateOut":{"properties":{"slug":{"type":"string","title":"Slug"},"status":{"type":"string","title":"Status"},"rotated_at":{"type":"string","format":"date-time","title":"Rotated At"}},"type":"object","required":["slug","status","rotated_at"],"title":"RotateOut"},"RunActionOut":{"properties":{"id":{"type":"integer","title":"Id"},"instance_id":{"type":"integer","title":"Instance Id"},"definition_key":{"type":"string","title":"Definition Key"},"status":{"type":"string","title":"Status"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","instance_id","definition_key","status","summary","created_at"],"title":"RunActionOut","description":"Response for POST /{instance_id}/run — the freshly queued run row."},"RunListOut":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/RunOut"},"type":"array","title":"Runs"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"}},"type":"object","required":["runs","counts"],"title":"RunListOut","description":"The task-tab payload: the (filtered, limited) runs plus the per-chip\ncounts computed across ALL of the tenant's runs."},"RunOut":{"properties":{"id":{"type":"integer","title":"Id"},"instance_id":{"type":"integer","title":"Instance Id"},"definition_key":{"type":"string","title":"Definition Key"},"agent_name":{"type":"string","title":"Agent Name"},"display_name":{"type":"string","title":"Display Name"},"status":{"type":"string","title":"Status"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"proposal":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Proposal"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"questions":{"items":{"$ref":"#/components/schemas/QuestionOut"},"type":"array","title":"Questions"}},"type":"object","required":["id","instance_id","definition_key","agent_name","display_name","status","summary","proposal","error","created_at","updated_at","questions"],"title":"RunOut","description":"Full run shape for the task tab: status, staged proposal/error, and any\nquestions attached to it."},"RunSummaryOut":{"properties":{"id":{"type":"integer","title":"Id"},"status":{"type":"string","title":"Status"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","status","summary","created_at"],"title":"RunSummaryOut","description":"Compact last-run line shown on an agent card (full detail lives in\nRunOut on the task tab)."},"RuntimeHandoffIn":{"properties":{"next":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Next"},"email":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Email"}},"type":"object","title":"RuntimeHandoffIn"},"RuntimeHandoffOut":{"properties":{"handoff_url":{"type":"string","title":"Handoff Url"}},"type":"object","required":["handoff_url"],"title":"RuntimeHandoffOut"},"SaveCustomIn":{"properties":{"builder_session_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Builder Session Id"},"draft":{"anyOf":[{"$ref":"#/components/schemas/AgentDraft"},{"type":"null"}]}},"type":"object","title":"SaveCustomIn"},"SeatsIn":{"properties":{"extra_seats":{"type":"integer","title":"Extra Seats"}},"type":"object","required":["extra_seats"],"title":"SeatsIn"},"SitemapIn":{"properties":{"site_url":{"type":"string","maxLength":500,"minLength":1,"title":"Site Url"},"sitemap_url":{"type":"string","maxLength":1000,"minLength":1,"title":"Sitemap Url"},"confirm":{"type":"boolean","title":"Confirm","default":false}},"type":"object","required":["site_url","sitemap_url"],"title":"SitemapIn"},"SocialCapabilitiesOut":{"properties":{"contract_version":{"type":"integer","const":2,"title":"Contract Version"},"agent_name":{"type":"string","title":"Agent Name"},"approval_default":{"type":"string","enum":["manual","approval_gated_auto"],"title":"Approval Default"},"auto_mode_available":{"type":"boolean","title":"Auto Mode Available"},"profile_configured":{"type":"boolean","title":"Profile Configured"},"idempotent_outbox":{"type":"boolean","title":"Idempotent Outbox"},"execution_receipts":{"type":"boolean","title":"Execution Receipts"},"connect_url":{"type":"string","title":"Connect Url"},"platforms":{"items":{"$ref":"#/components/schemas/SocialPlatformCapabilities"},"type":"array","title":"Platforms"}},"additionalProperties":false,"type":"object","required":["contract_version","agent_name","approval_default","auto_mode_available","profile_configured","idempotent_outbox","execution_receipts","connect_url","platforms"],"title":"SocialCapabilitiesOut"},"SocialContentIn":{"properties":{"message":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Message"},"link_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Link Url"},"media_asset_ids":{"items":{"type":"string"},"type":"array","maxItems":10,"title":"Media Asset Ids"},"moderation_action":{"anyOf":[{"type":"string","enum":["hide","delete","reply","ignore"]},{"type":"null"}],"title":"Moderation Action"}},"additionalProperties":false,"type":"object","title":"SocialContentIn"},"SocialDecisionIn":{"properties":{"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Reason"}},"additionalProperties":false,"type":"object","title":"SocialDecisionIn"},"SocialIntentCreateIn":{"properties":{"intent_type":{"type":"string","enum":["post","reply","moderate_comment"],"title":"Intent Type"},"content":{"$ref":"#/components/schemas/SocialContentIn"},"target_ref":{"anyOf":[{"type":"string","maxLength":240},{"type":"null"}],"title":"Target Ref"},"scheduled_for":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled For"},"binding_id":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Binding Id"},"idempotency_key":{"type":"string","maxLength":128,"minLength":16,"title":"Idempotency Key"}},"additionalProperties":false,"type":"object","required":["intent_type","content","idempotency_key"],"title":"SocialIntentCreateIn"},"SocialIntentEditIn":{"properties":{"content":{"$ref":"#/components/schemas/SocialContentIn"},"target_ref":{"anyOf":[{"type":"string","maxLength":240},{"type":"null"}],"title":"Target Ref"},"scheduled_for":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled For"},"binding_id":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Binding Id"}},"additionalProperties":false,"type":"object","required":["content"],"title":"SocialIntentEditIn"},"SocialPlatformCapabilities":{"properties":{"platform":{"type":"string","enum":["facebook","instagram"],"title":"Platform"},"label":{"type":"string","title":"Label"},"read_insights":{"type":"boolean","title":"Read Insights"},"draft":{"type":"boolean","title":"Draft"},"schedule":{"type":"boolean","title":"Schedule"},"publish":{"type":"boolean","title":"Publish"},"comments":{"type":"boolean","title":"Comments"},"inbox":{"type":"boolean","title":"Inbox"},"approval_execute":{"type":"boolean","title":"Approval Execute"},"unavailable_reason":{"type":"string","title":"Unavailable Reason"}},"additionalProperties":false,"type":"object","required":["platform","label","read_insights","draft","schedule","publish","comments","inbox","approval_execute","unavailable_reason"],"title":"SocialPlatformCapabilities"},"SpendPointOut":{"properties":{"date":{"type":"string","title":"Date"},"spend":{"type":"number","title":"Spend"}},"type":"object","required":["date","spend"],"title":"SpendPointOut"},"StartChatAgentRunIn":{"properties":{"instance_id":{"type":"integer","title":"Instance Id"}},"type":"object","required":["instance_id"],"title":"StartChatAgentRunIn"},"StartIn":{"properties":{"request_key":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Request Key"},"question_cards":{"type":"boolean","title":"Question Cards","default":false}},"type":"object","required":["request_key"],"title":"StartIn"},"StatOut":{"properties":{"value":{"type":"string","title":"Value"},"label":{"type":"string","title":"Label"}},"type":"object","required":["value","label"],"title":"StatOut"},"SupportChatIn":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/SupportMessage"},"type":"array","maxItems":100,"title":"Messages"},"conversation_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Conversation Id"},"runtime_identity":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Runtime Identity"},"attachment_ids":{"items":{"type":"string"},"type":"array","maxItems":10,"title":"Attachment Ids"}},"type":"object","required":["messages"],"title":"SupportChatIn"},"SupportConversationDetail":{"properties":{"conversation":{"$ref":"#/components/schemas/SupportConversationRow"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"messages":{"items":{"$ref":"#/components/schemas/SupportMessageRow"},"type":"array","title":"Messages"}},"additionalProperties":false,"type":"object","required":["conversation","messages"],"title":"SupportConversationDetail"},"SupportConversationList":{"properties":{"conversations":{"items":{"$ref":"#/components/schemas/SupportConversationRow"},"type":"array","title":"Conversations"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"additionalProperties":false,"type":"object","required":["conversations","total","limit","offset"],"title":"SupportConversationList"},"SupportConversationRow":{"properties":{"id":{"type":"string","title":"Id"},"channel":{"type":"string","title":"Channel"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Startedat"},"lastMessageAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lastmessageat"},"tenantId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenantid"},"tenantName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenantname"},"userEmail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Useremail"},"firstUserLine":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firstuserline"},"messageCount":{"type":"integer","title":"Messagecount"},"hasSummary":{"type":"boolean","title":"Hassummary"}},"additionalProperties":false,"type":"object","required":["id","channel","messageCount","hasSummary"],"title":"SupportConversationRow","description":"One conversation as the list needs it: who, when, and the opening line."},"SupportMessage":{"properties":{"role":{"type":"string","pattern":"^(user|assistant)$","title":"Role"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"SupportMessage"},"SupportMessageRow":{"properties":{"id":{"type":"string","title":"Id"},"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Createdat"},"tokenCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tokencount"}},"additionalProperties":false,"type":"object","required":["id","role","content"],"title":"SupportMessageRow"},"TeamOut":{"properties":{"workspace_name":{"type":"string","title":"Workspace Name"},"tier":{"type":"string","title":"Tier"},"role":{"type":"string","title":"Role"},"can_manage":{"type":"boolean","title":"Can Manage"},"seats":{"additionalProperties":true,"type":"object","title":"Seats"},"members":{"items":{"$ref":"#/components/schemas/MemberOut"},"type":"array","title":"Members"},"invites":{"items":{"$ref":"#/components/schemas/InviteOut"},"type":"array","title":"Invites"}},"type":"object","required":["workspace_name","tier","role","can_manage","seats","members","invites"],"title":"TeamOut"},"TelegramExchangeRequest":{"properties":{"init_data":{"type":"string","maxLength":16384,"minLength":1,"title":"Init Data"},"user_code":{"type":"string","maxLength":32,"minLength":1,"title":"User Code"}},"additionalProperties":false,"type":"object","required":["init_data","user_code"],"title":"TelegramExchangeRequest"},"TelegramSessionRequest":{"properties":{"init_data":{"type":"string","maxLength":16384,"minLength":1,"title":"Init Data"}},"additionalProperties":false,"type":"object","required":["init_data"],"title":"TelegramSessionRequest"},"TenantAccount":{"properties":{"tenantId":{"type":"string","title":"Tenantid"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"kind":{"type":"string","title":"Kind"},"status":{"type":"string","title":"Status"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Createdat"},"plan":{"$ref":"#/components/schemas/TenantPlanRow"},"writesEnabled":{"type":"boolean","title":"Writesenabled"},"gptAllowed":{"type":"boolean","title":"Gptallowed"},"members":{"items":{"$ref":"#/components/schemas/AccountMember"},"type":"array","title":"Members"},"connectors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Connectors"},"usageTodayUsd":{"type":"number","title":"Usagetodayusd"},"models":{"$ref":"#/components/schemas/AccountModels"}},"additionalProperties":false,"type":"object","required":["tenantId","name","slug","kind","status","plan","writesEnabled","gptAllowed","members","connectors","usageTodayUsd","models"],"title":"TenantAccount","description":"Everything an operator or agent needs about one account, in one read."},"TenantPlanRow":{"properties":{"tenantId":{"type":"string","title":"Tenantid"},"name":{"type":"string","title":"Name"},"tier":{"type":"string","title":"Tier"},"status":{"type":"string","title":"Status"},"billingSource":{"type":"string","title":"Billingsource"},"members":{"type":"integer","title":"Members"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updatedat"},"editable":{"type":"boolean","title":"Editable"}},"additionalProperties":false,"type":"object","required":["tenantId","name","tier","status","billingSource","members","editable"],"title":"TenantPlanRow","description":"One tenant's entitlement as an operator needs to see it."},"TenantRoster":{"properties":{"tenants":{"items":{"$ref":"#/components/schemas/TenantPlanRow"},"type":"array","title":"Tenants"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"additionalProperties":false,"type":"object","required":["tenants","total","limit","offset"],"title":"TenantRoster"},"TestimonialOut":{"properties":{"id":{"type":"integer","title":"Id"},"quote":{"type":"string","title":"Quote"},"name":{"type":"string","title":"Name"},"title":{"type":"string","title":"Title"}},"type":"object","required":["id","quote","name","title"],"title":"TestimonialOut"},"TokenOut":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"}},"type":"object","required":["access_token"],"title":"TokenOut"},"UserOut":{"properties":{"id":{"type":"integer","title":"Id"},"email":{"type":"string","format":"email","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"picture":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Picture"},"tenant_id":{"type":"integer","title":"Tenant Id"},"tenant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Name"},"role":{"type":"string","title":"Role"},"can_manage":{"type":"boolean","title":"Can Manage"},"is_superuser":{"type":"boolean","title":"Is Superuser"},"auto_model_bias":{"type":"string","title":"Auto Model Bias"},"free_models":{"items":{"type":"string"},"type":"array","title":"Free Models","default":[]}},"type":"object","required":["id","email","tenant_id","role","can_manage","is_superuser","auto_model_bias"],"title":"UserOut"},"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"},"VerifiedAdSavingsImpactOut":{"properties":{"state":{"type":"string","enum":["verified","estimated","unavailable"],"title":"State"},"selection_state":{"type":"string","enum":["bound","unavailable"],"title":"Selection State"},"aggregation_grain":{"type":"string","enum":["observed_verified_savings_partition_utc_day","observed_estimated_savings_scope_utc_day","unavailable"],"title":"Aggregation Grain"},"additivity_state":{"type":"string","enum":["proven","unavailable"],"title":"Additivity State"},"additivity_proof":{"anyOf":[{"type":"string","enum":["single_observed_verified_partition","single_observed_estimated_scope"]},{"type":"null"}],"title":"Additivity Proof"},"coverage_state":{"type":"string","enum":["complete","unknown","unavailable"],"title":"Coverage State"},"coverage_scope":{"type":"string","enum":["selected_portfolio","observed_subset","unavailable"],"title":"Coverage Scope"},"headline_eligible":{"type":"boolean","title":"Headline Eligible"},"direction":{"type":"string","enum":["savings","loss","neutral","unavailable"],"title":"Direction"},"amount_minor":{"anyOf":[{"type":"integer","maximum":9007199254740991.0,"minimum":-9007199254740991.0},{"type":"null"}],"title":"Amount Minor"},"estimated_amount_minor":{"anyOf":[{"type":"integer","maximum":9007199254740991.0,"minimum":-9007199254740991.0},{"type":"null"}],"title":"Estimated Amount Minor"},"confidence":{"type":"string","enum":["high","medium","low","unavailable"],"title":"Confidence"},"basis":{"anyOf":[{"type":"string","enum":["approved_applied_optimization_counterfactual","connector_estimate"]},{"type":"null"}],"title":"Basis"},"formula":{"anyOf":[{"type":"string","enum":["counterfactual_spend_minor - observed_spend_minor","source_supplied_estimated_savings_minor"]},{"type":"null"}],"title":"Formula"},"exclusions":{"items":{"type":"string","enum":["estimated_measurements","unapproved_optimizations","unapplied_or_rolled_back_actions"]},"type":"array","title":"Exclusions"},"provenance":{"items":{"$ref":"#/components/schemas/ImpactProvenanceOut"},"type":"array","title":"Provenance"},"freshness":{"$ref":"#/components/schemas/ImpactFreshnessOut"},"estimated_confidence":{"type":"string","enum":["high","medium","low","unavailable"],"title":"Estimated Confidence"},"estimated_provenance":{"items":{"$ref":"#/components/schemas/ImpactProvenanceOut"},"type":"array","title":"Estimated Provenance"},"estimated_freshness":{"$ref":"#/components/schemas/ImpactFreshnessOut"}},"type":"object","required":["state","selection_state","aggregation_grain","additivity_state","additivity_proof","coverage_state","coverage_scope","headline_eligible","direction","amount_minor","estimated_amount_minor","confidence","basis","formula","provenance","freshness","estimated_confidence","estimated_provenance","estimated_freshness"],"title":"VerifiedAdSavingsImpactOut"},"VerifyIn":{"properties":{"code":{"type":"string","maxLength":10,"minLength":4,"title":"Code"}},"type":"object","required":["code"],"title":"VerifyIn"},"VerifyLoginEmailIn":{"properties":{"token":{"type":"string","maxLength":512,"minLength":10,"title":"Token"}},"type":"object","required":["token"],"title":"VerifyLoginEmailIn"},"VerifyLoginEmailOut":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"VerifyLoginEmailOut"},"WebhookOut":{"properties":{"ok":{"type":"boolean","title":"Ok"},"handled":{"type":"string","title":"Handled"}},"type":"object","required":["ok","handled"],"title":"WebhookOut"},"WorkspaceIntegrationOut":{"properties":{"platform":{"type":"string","title":"Platform"},"displayName":{"type":"string","title":"Displayname"},"accountId":{"type":"string","title":"Accountid"},"accountName":{"type":"string","title":"Accountname"},"status":{"type":"string","title":"Status"},"runtimeState":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runtimestate"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"chattable":{"type":"boolean","title":"Chattable","default":false},"managed":{"type":"boolean","title":"Managed","default":false},"chat":{"anyOf":[{"$ref":"#/components/schemas/AccountChatOut"},{"type":"null"}]}},"type":"object","required":["platform","displayName","accountId","accountName","status"],"title":"WorkspaceIntegrationOut"},"WorkspaceNameIn":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"WorkspaceNameIn","description":"Rename the caller's current workspace.\n\nBounded by the `tenants.name` column (String(200)). Whitespace-only input is\nrejected rather than silently stored, so \"named\" and \"not named\" stay two\ndistinguishable states."},"WorkspaceNameOut":{"properties":{"tenant_id":{"type":"integer","title":"Tenant Id"},"tenant_name":{"type":"string","title":"Tenant Name"}},"type":"object","required":["tenant_id","tenant_name"],"title":"WorkspaceNameOut"},"app__chat_continuation__AnswerIn":{"properties":{"question_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Question Id"},"version":{"type":"integer","minimum":1.0,"title":"Version"},"continuation_token":{"type":"string","maxLength":128,"minLength":32,"pattern":"^[A-Za-z0-9_-]+$","title":"Continuation Token"},"option_id":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Option Id"},"free_text":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Free Text"}},"additionalProperties":false,"type":"object","required":["question_id","version","continuation_token"],"title":"AnswerIn"},"app__compat_projects_schemas__WorkspaceOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"integrations":{"items":{"$ref":"#/components/schemas/WorkspaceIntegrationOut"},"type":"array","title":"Integrations"},"connectedCount":{"type":"integer","title":"Connectedcount"}},"type":"object","required":["id","name","status","integrations","connectedCount"],"title":"WorkspaceOut"},"app__compat_projects_schemas__WorkspacesOut":{"properties":{"workspaces":{"items":{"$ref":"#/components/schemas/app__compat_projects_schemas__WorkspaceOut"},"type":"array","title":"Workspaces"}},"type":"object","required":["workspaces"],"title":"WorkspacesOut"},"app__routers__agent_harness__AnswerIn":{"properties":{"version":{"type":"integer","minimum":1.0,"title":"Version"},"continuation_token":{"type":"string","maxLength":100,"minLength":20,"title":"Continuation Token"},"option_id":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Option Id"},"free_text":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Free Text"}},"type":"object","required":["version","continuation_token"],"title":"AnswerIn"},"app__routers__agents__AnswerIn":{"properties":{"answer":{"type":"string","maxLength":4000,"minLength":1,"title":"Answer"}},"type":"object","required":["answer"],"title":"AnswerIn","description":"Request body for answering a question (1..4000 chars, validated by\nPydantic before the handler runs)."},"app__routers__team__WorkspaceOut":{"properties":{"tenant_id":{"type":"integer","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"kind":{"type":"string","title":"Kind"},"current":{"type":"boolean","title":"Current"}},"type":"object","required":["tenant_id","name","role","kind","current"],"title":"WorkspaceOut"},"app__routers__team__WorkspacesOut":{"properties":{"workspaces":{"items":{"$ref":"#/components/schemas/app__routers__team__WorkspaceOut"},"type":"array","title":"Workspaces"}},"type":"object","required":["workspaces"],"title":"WorkspacesOut"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}