{"openapi":"3.1.0","info":{"title":"OnSuite Tenant API","version":"0.1.0"},"paths":{"/api/auth/me":{"get":{"tags":["auth"],"summary":"Auth Me","operationId":"auth_me_api_auth_me_get","parameters":[{"name":"X-Company-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthMeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/signup":{"post":{"tags":["auth"],"summary":"Auth Signup","operationId":"auth_signup_api_auth_signup_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/change-password":{"post":{"tags":["auth"],"summary":"Change Password","description":"Change password and clear force_password_change. Used on first login for admin-created accounts.","operationId":"change_password_api_auth_change_password_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","description":"Revoke the caller's OWN GoTrue session — the one the presented token rides on.\n\nCalled by the platform logout chain instead of (in addition to) a client-side\nsupabase.auth.signOut(). Revoking the session invalidates its refresh tokens\nimmediately, so a leaked/stale browser access_token can't be refreshed once it\nexpires. GoTrue does the revoking — see _gotrue_revoke_own_session for why this\nis not a DELETE, and why no database grant can make it one again.\n\nScope is the `session_id` claim on the caller's JWT, never a user_agent guess.\nThis used to delete every session whose user_agent didn't look like a native app\n(Expo|okhttp|CFNetwork|Dalvik|onsuite-mobile), which meant signing out in ONE\nbrowser revoked the user's session on EVERY other device that runs a browser —\nthe daily mobile-web re-login of plan 123, and our own desktop app losing its\nsession. A user agent cannot tell \"another origin in this browser\" apart from\n\"the same browser on another device\", so it is the wrong question: do not\nreintroduce a UA match here, not even a wider one.\n\nAccepted cost, deliberately: an app origin the logout redirect chain never\nreaches keeps its own session row until its access token expires (<=1h) instead\nof being revoked on the spot. That is strictly narrower than the alternative it\nreplaced, which was revoking the user's sessions on every device they own.\n\n\"Log out everywhere\" is a different operation and is unaffected — it goes\nthrough supabase.auth.signOut({ scope: 'global' }) in @onsuite/lib, which\nrevokes every session for the user.","operationId":"logout_api_auth_logout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"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 caller's account (Apple Guideline 5.1.1(v)).\n\nStrategy: anonymize + revoke (no cross-schema hard delete — app rows keep an\nanonymized logical ref). Steps, in order so the credential can never revive the\nprofile:\n  1. Block if the caller is the canonical owner (companies.owner_user_id) of a\n     workspace that still has other active members — they must transfer/remove first.\n  2. Delete the Supabase auth user (the linchpin: kills the credential so a later\n     login can't re-create the profile via _get_or_create_user). Idempotent (404 ok).\n  3. In one txn: delete solo-owned workspaces (cascades their members/apps/app-data),\n     scrub PII from users + mark inactive, drop remaining memberships (revoke\n     access to workspaces owned by others), and revoke all GoTrue sessions.","operationId":"delete_account_api_auth_account_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/profile":{"put":{"tags":["auth"],"summary":"Update Profile","operationId":"update_profile_api_auth_profile_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEnvelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/preferences":{"patch":{"tags":["auth"],"summary":"Update Preferences","description":"Shallow-merge UI preferences (sidebar/content theme, density, per-app overrides).","operationId":"update_preferences_api_auth_preferences_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEnvelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/magic-link":{"post":{"tags":["auth"],"summary":"Send Magic Login Link","description":"Email a one-click sign-in link (public — this IS a login path).\n\nEXISTING accounts only: GoTrue 'magiclink' type never creates users, so the login screen\ncannot become a signup side-door. Anti-enumeration: the response is identical whether the\naccount exists or not — only the mailbox owner learns which.","operationId":"send_magic_login_link_api_auth_magic_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MagicLinkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/impersonation":{"get":{"tags":["auth"],"summary":"Impersonation Info","description":"Who is driving this session? {active:false} for genuine logins; else the operator's\nidentity + expiry, for the lib banner.","operationId":"impersonation_info_api_auth_impersonation_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/impersonation/end":{"post":{"tags":["auth"],"summary":"Impersonation Self End","description":"End THIS session's impersonation grant from inside the impersonated app (banner button).\nActor in the audit row is the OPERATOR (act.sub) — they are the one driving.","operationId":"impersonation_self_end_api_auth_impersonation_end_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/":{"get":{"tags":["companies"],"summary":"List Companies","operationId":"list_companies_api_companies__get","parameters":[{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompaniesListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["companies"],"summary":"Create Company","operationId":"create_company_api_companies__post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyEnvelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/{company_id}":{"delete":{"tags":["companies"],"summary":"Delete Company","description":"PERMANENTLY delete a workspace. Owner only.\n\nEverything platform-side referencing the company cascades (memberships, app installs,\ninvitations, connections, jobs — all FKs are ON DELETE CASCADE). Post plan 078 there is no\nusers.current_company_id to repoint: per-tab workspace is client session state, and the\ndefault workspace lives on company_users.is_default — a row this delete cascades away, after\nwhich the bootstrap simply falls back to the member's next workspace. App-side data\n(e.g. oncompliance.*) is each app's to remove — the delete flow calls the app's own purge\nendpoint BEFORE this one, so the workspace disappears last, not first.","operationId":"delete_company_api_companies__company_id__delete","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["companies"],"summary":"Get Company","operationId":"get_company_api_companies__company_id__get","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["companies"],"summary":"Update Company","operationId":"update_company_api_companies__company_id__patch","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyEnvelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["companies"],"summary":"Update Company","operationId":"update_company_api_companies__company_id__put","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyEnvelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/{company_id}/set-default":{"post":{"tags":["companies"],"summary":"Set Default Company","description":"Make this the caller's default workspace — where they land with no session preference.\n\nDeliberately durable and explicit, unlike the thing it replaces: users.current_company_id\ndrifted silently on every workspace *create*, so nobody's \"default\" was ever a choice they\nmade (plan 078). Ordering the bootstrap by is_default is what gives this effect\n(auth.py · _load_bootstrap).\n\nAny active member may set their own default — this is a per-user preference on their own\nmembership row, not a workspace-level setting, so it needs no role gate.","operationId":"set_default_company_api_companies__company_id__set_default_post","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/{company_id}/invitations":{"get":{"tags":["members"],"summary":"List Company Invitations","description":"List invitations sent by a company (admin+ only).\n\nstatus: all | pending | accepted | revoked (default: all)","operationId":"list_company_invitations_api_companies__company_id__invitations_get","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"all","title":"Status"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/{company_id}/members":{"get":{"tags":["members"],"summary":"List Members","operationId":"list_members_api_companies__company_id__members_get","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembersListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/{company_id}/members/invite":{"post":{"tags":["members"],"summary":"Invite Member","operationId":"invite_member_api_companies__company_id__members_invite_post","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/{company_id}/members/invite-with-credentials":{"post":{"tags":["members"],"summary":"Invite Member With Credentials","description":"Create a Supabase account for the user, add them to the workspace, and return a\none-time temp password. The user must change it on first login.","operationId":"invite_member_with_credentials_api_companies__company_id__members_invite_with_credentials_post","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteWithCredentialsRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteWithCredentialsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/team":{"get":{"tags":["members"],"summary":"Get Cross Company Team","description":"Members across every company the authenticated user belongs to.\n\n- No ``app_slug`` (platform mode, onsuite-app): every active member, each with all\n  their app_roles.\n- ``app_slug=<slug>`` (single-app mode, used by child apps): only members who hold a\n  role in that app, and each member's app_roles is scoped to that app — so a child\n  app never receives the membership of other apps over the wire.\n\nNOTE: this is response *scoping*, not a hard authz boundary — ``app_slug`` is\nclient-supplied and the JWT carries no app identity. See\nonsuite-docs/architecture for the per-app-token design that would enforce it.","operationId":"get_cross_company_team_api_team_get","parameters":[{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/{company_id}/invitations/{invitation_id}":{"delete":{"tags":["members"],"summary":"Revoke Invitation","description":"Revoke a SENT invitation (admin/owner of the company). Accept requires status='pending',\nso flipping to 'revoked' invalidates the link even though the signed token lives until expiry.","operationId":"revoke_invitation_api_companies__company_id__invitations__invitation_id__delete","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/invitations/sent":{"get":{"tags":["members"],"summary":"Get Cross Company Sent Invitations","description":"All invitations from every company the user manages (owner or admin).\n\nstatus: all | pending | accepted | revoked (default: all)\napp_slug: when set (single-app mode, child apps), only invitations for that\n  app; omitted (platform mode, onsuite-app) returns every app's invitations.","operationId":"get_cross_company_sent_invitations_api_invitations_sent_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"all","title":"Status"}},{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/invitations/pending":{"get":{"tags":["members"],"summary":"List Pending Invitations","description":"List invitations for the authenticated user's email.\n\nstatus: all | pending | accepted | revoked (default: all)\napp_slug: when set (single-app mode, child apps), only invitations for that\n  app; omitted (platform mode, onsuite-app) returns every app's invitations.","operationId":"list_pending_invitations_api_invitations_pending_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"all","title":"Status"}},{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/invitations/accept":{"post":{"tags":["members"],"summary":"Accept Invite","operationId":"accept_invite_api_invitations_accept_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/invitations/{invitation_id}/accept":{"post":{"tags":["members"],"summary":"Accept Invite By Id","description":"Accept a received invitation by ID — no invite token needed, email verified server-side.","operationId":"accept_invite_by_id_api_invitations__invitation_id__accept_post","parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/invitations/{invitation_id}/decline":{"post":{"tags":["members"],"summary":"Decline Invite By Id","description":"Decline a received invitation — sets status to revoked.","operationId":"decline_invite_by_id_api_invitations__invitation_id__decline_post","parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/{company_id}/members/{member_id}":{"put":{"tags":["members"],"summary":"Update Member","operationId":"update_member_api_companies__company_id__members__member_id__put","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberEnvelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["members"],"summary":"Remove Member","operationId":"remove_member_api_companies__company_id__members__member_id__delete","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/apps/logout-urls":{"get":{"tags":["apps"],"summary":"Get Logout Urls","description":"Public endpoint (no auth) — returns child app logout URLs for the global signout chain.\n\nOnly returns ui_base_url for published apps (resolved from env by enrich_app).\nNo sensitive data exposed — just public URLs.","operationId":"get_logout_urls_api_apps_logout_urls_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutUrlsResponse"}}}}}}},"/api/apps/":{"get":{"tags":["apps"],"summary":"List Apps","operationId":"list_apps_api_apps__get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/apps/installed":{"get":{"tags":["apps"],"summary":"List Installed","operationId":"list_installed_api_apps_installed_get","parameters":[{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstalledAppsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/apps/install":{"post":{"tags":["apps"],"summary":"Install App","operationId":"install_app_api_apps_install_post","parameters":[{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppInstallRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/apps/{slug}/install":{"post":{"tags":["apps"],"summary":"Install App By Slug","description":"Install an app by slug for the given company (X-Company-ID).\n\nUsed by the workspace picker on the platform SSO page — lets a user subscribe\nto an app in any of their workspaces without leaving the SSO launch flow.","operationId":"install_app_by_slug_api_apps__slug__install_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/apps/{slug}/complete-onboarding":{"post":{"tags":["apps"],"summary":"Complete Onboarding","operationId":"complete_onboarding_api_apps__slug__complete_onboarding_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingStateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/apps/{slug}/reset-onboarding":{"post":{"tags":["apps"],"summary":"Reset Onboarding","operationId":"reset_onboarding_api_apps__slug__reset_onboarding_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingStateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/apps/uninstall":{"post":{"tags":["apps"],"summary":"Uninstall App","operationId":"uninstall_app_api_apps_uninstall_post","parameters":[{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppInstallRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/rbac/permissions":{"get":{"tags":["rbac"],"summary":"Get Permissions","description":"Get effective permissions for the authenticated user in a company for a specific app.\n\nA superuser role (app_roles.is_superuser, e.g. `owner`) resolves to EVERY action defined\nfor the app — so it needs no role_actions rows and auto-covers actions added later. All\nother roles resolve to the union of their explicitly-granted role_actions.\n\nAlso the platform's MEMBERSHIP ORACLE for child apps: a caller who is not an active member\nof company_id gets 403 (not empty permissions). onsuite_auth's resolve_user fails closed on\nthat, so a spoofed X-Company-ID can't impersonate another workspace in app backends.","operationId":"get_permissions_api_rbac_permissions_get","parameters":[{"name":"app_slug","in":"query","required":true,"schema":{"type":"string","title":"App Slug"}},{"name":"company_id","in":"query","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/rbac/permissions/batch":{"get":{"tags":["rbac"],"summary":"Get Permissions Batch","description":"Effective permissions for the caller in EVERY workspace they are an active member of,\nfor one app — one oracle round-trip for cross-workspace features (consolidated statements,\nZoho import targets) instead of one per workspace.\n\nA workspace ABSENT from the results means the caller is not an active member there — the\nbatch equivalent of the single endpoint's 403; callers MUST fail closed on absence. Owner\nauto-assignment applies per returned workspace exactly as on the single endpoint (so an\nowner's first batch call materializes their owner app-role in every workspace they own).","operationId":"get_permissions_batch_api_rbac_permissions_batch_get","parameters":[{"name":"app_slug","in":"query","required":true,"schema":{"type":"string","title":"App Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchPermissionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/apps/{app_slug}/roles":{"get":{"tags":["rbac"],"summary":"List App Roles","operationId":"list_app_roles_api_apps__app_slug__roles_get","parameters":[{"name":"app_slug","in":"path","required":true,"schema":{"type":"string","title":"App Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppRolesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/apps/{app_slug}/modules":{"get":{"tags":["rbac"],"summary":"List App Modules","description":"Module DEFINITIONS an app declares (plan 062) — from its app-registration.json via\nregister_app.py. Per-workspace effective state is the /api/companies/… endpoint below.","operationId":"list_app_modules_api_apps__app_slug__modules_get","parameters":[{"name":"app_slug","in":"path","required":true,"schema":{"type":"string","title":"App Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppModulesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/{company_id}/apps/{app_slug}/modules":{"get":{"tags":["rbac"],"summary":"Company App Modules","description":"Effective per-workspace module state (any active member): every module the app declares,\nwith enabled = COALESCE(override, default_enabled) and whether an override row exists.","operationId":"company_app_modules_api_companies__company_id__apps__app_slug__modules_get","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"app_slug","in":"path","required":true,"schema":{"type":"string","title":"App Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyModulesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/{company_id}/apps/{app_slug}/modules/{module_key}":{"put":{"tags":["rbac"],"summary":"Set Company App Module","description":"Toggle one module for a workspace (admin+). Writes an explicit override row — deleting a\nmodule from the app's manifest (register-app --prune) removes the overrides with it. Child\napps see the change within their permissions-cache window (~5 min), like role changes.","operationId":"set_company_app_module_api_companies__company_id__apps__app_slug__modules__module_key__put","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"app_slug","in":"path","required":true,"schema":{"type":"string","title":"App Slug"}},{"name":"module_key","in":"path","required":true,"schema":{"type":"string","title":"Module Key"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModuleToggleIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/apps/{app_slug}/actions":{"get":{"tags":["rbac"],"summary":"List App Actions","operationId":"list_app_actions_api_apps__app_slug__actions_get","parameters":[{"name":"app_slug","in":"path","required":true,"schema":{"type":"string","title":"App Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppActionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/{company_id}/members/{member_id}/app-roles":{"post":{"tags":["rbac"],"summary":"Assign App Role","operationId":"assign_app_role_api_companies__company_id__members__member_id__app_roles_post","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppRoleAssign"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/companies/{company_id}/members/{member_id}/app-roles/{role_id}":{"delete":{"tags":["rbac"],"summary":"Revoke App Role","operationId":"revoke_app_role_api_companies__company_id__members__member_id__app_roles__role_id__delete","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}},{"name":"role_id","in":"path","required":true,"schema":{"type":"string","title":"Role Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sso/launch":{"post":{"tags":["sso"],"summary":"Sso Launch","description":"Generate an SSO launch URL for a child app.\n\nGenerates a single-use magic-link token (via GoTrue admin API) so the child\napp can call verifyOtp() client-side to establish an independent session with\nnative auto-refresh. Falls back to the caller's access_token (~1hr) if\ntoken generation fails.","operationId":"sso_launch_api_sso_launch_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSOLaunchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSOLaunchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sso/device":{"post":{"tags":["sso"],"summary":"Device Authorize","description":"Start a device authorization. UNAUTHENTICATED — the device has no user yet.\n\nThe only thing trusted about the caller is that `app_slug` names a published catalog app\n(the RFC's `client_id` role). The row it creates grants nothing until an authenticated human\napproves it, lives 600s, and is bounded per-IP.","operationId":"device_authorize_api_sso_device_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceAuthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceAuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sso/device/lookup":{"post":{"tags":["sso"],"summary":"Device Lookup","description":"What is this code asking for? Authenticated — every guess is attributable and rate-limited.","operationId":"device_lookup_api_sso_device_lookup_post","parameters":[{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCodeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceLookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sso/device/approve":{"post":{"tags":["sso"],"summary":"Device Approve","description":"The consent. Runs `_resolve_launch_target` — the SAME membership/installed checks, and the\nsame error strings, that `/sso/launch` runs — so a company without the app installed fails for\na device exactly as it fails for the launcher.\n\nException: a CONSUMER app's sign-in (decision 008) never fails for want of an install. It binds\na workspace where the person can already use the app, or none (`company_id` NULL) — see\n`_resolve_consumer_signin_target`. Enrolment and every non-consumer sign-in are unchanged.\n\nNo token is minted here. The row records WHO approved and FOR WHICH company; the credential is\nminted at exchange time and never stored.\n\nTHIS is the endpoint the guessing budget has to guard — it is the one that grants. The failure\nis recorded outside the transaction on purpose: a wrong code aborts the transaction, and a\ncounter that rolls back with it counts nothing.","operationId":"device_approve_api_sso_device_approve_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceApproveIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sso/device/deny":{"post":{"tags":["sso"],"summary":"Device Deny","description":"An explicit refusal kills the code immediately — the device stops polling on `access_denied`.","operationId":"device_deny_api_sso_device_deny_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCodeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sso/device/token":{"post":{"tags":["sso"],"summary":"Device Token","description":"The device exchanges its `device_code` for the launch payload. UNAUTHENTICATED by design —\npossession of the `device_code` IS the authentication, which is why it is hashed at rest and\nnever leaves the device's own process.\n\nReturns RFC 8628 errors (`authorization_pending`, `slow_down`, `expired_token`,\n`access_denied`) until the human acts, then the same payload `/sso` returns today.","operationId":"device_token_api_sso_device_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTokenIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lookup/handles/search":{"get":{"tags":["lookup"],"summary":"Search Handles","description":"Typeahead for user handles → `@handle` matches (plan 070).\n\nMatches the global user handle. Profile basics only (no email/phone); auth-gated.","operationId":"search_handles_api_lookup_handles_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"description":"Partial user handle","title":"Q"},"description":"Partial user handle"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":8,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandleSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lookup/handle":{"get":{"tags":["lookup"],"summary":"Resolve Handle","description":"Resolve `@alice` → a user, or `@ws:acme` → a workspace (plan 070). Profile basics only; auth-gated.\n\nFor a user handle, falls back to user_handle_history so an OLD (renamed) handle still resolves to the\ncurrent user, with redirected=true. Returns minimal fields to limit handle enumeration.","operationId":"resolve_handle_api_lookup_handle_get","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string","description":"A user handle @alice, or a workspace handle @ws:acme","title":"Address"},"description":"A user handle @alice, or a workspace handle @ws:acme"},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandleResolveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lookup/users/search":{"get":{"tags":["lookup"],"summary":"Search Users","description":"Search active users by name/email/phone.\n\nTwo modes:\n  • `app` given  → only users who have completed onboarding for that app slug\n    (company_apps.onboarded_at IS NOT NULL). For \"share with someone who already\n    has the app\" flows (e.g. onclock).\n  • `app` omitted → all active users. For invite/add-member flows, where the whole\n    point is to find someone who is NOT yet on the target app.","operationId":"search_users_api_lookup_users_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"description":"Search term — matched against name, email, phone","title":"Q"},"description":"Search term — matched against name, email, phone"},{"name":"app","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional app slug — if given, only returns users already onboarded to this app (share-with-existing-users case). Omit to search all active users (invite/add-member case).","title":"App"},"description":"Optional app slug — if given, only returns users already onboarded to this app (share-with-existing-users case). Omit to search all active users (invite/add-member case)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupUsersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lookup/users":{"get":{"tags":["lookup"],"summary":"Batch Get Users","description":"Batch fetch user display data by id, auth_id, or workspace membership.\n\nUsed by app-specific APIs for API composition. `company_ids` resolves through\ncompany_users — it answers \"who belongs to these workspaces\", which is what every\ncaller actually wanted. It used to match users.current_company_id, i.e. \"who last landed\nhere\", which silently omitted anyone with more than one workspace (plan 078).","operationId":"batch_get_users_api_lookup_users_get","parameters":[{"name":"ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of public.users UUIDs","title":"Ids"},"description":"Comma-separated list of public.users UUIDs"},{"name":"auth_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of auth_id (sub) values","title":"Auth Ids"},"description":"Comma-separated list of auth_id (sub) values"},{"name":"company_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of company UUIDs — returns every ACTIVE MEMBER of those workspaces","title":"Company Ids"},"description":"Comma-separated list of company UUIDs — returns every ACTIVE MEMBER of those workspaces"},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupUsersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lookup/companies":{"get":{"tags":["lookup"],"summary":"Batch Get Companies","description":"Batch fetch company display data by id. Used by app-specific APIs for API composition.","operationId":"batch_get_companies_api_lookup_companies_get","parameters":[{"name":"ids","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated list of company UUIDs","title":"Ids"},"description":"Comma-separated list of company UUIDs"},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupCompaniesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/profile/identities":{"get":{"tags":["identities"],"summary":"List Identities","description":"Return OAuth providers (from JWT) + custom identities (from DB) in one response.","operationId":"list_identities_api_profile_identities_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdentitiesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["identities"],"summary":"Link Identity","description":"Link a custom identity (e.g. WhatsApp phone) to the current user.","operationId":"link_identity_api_profile_identities_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkIdentityRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomIdentity"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/profile/identities/{identity_id}":{"delete":{"tags":["identities"],"summary":"Unlink Identity","description":"Unlink a custom identity. Blocked if it's the user's only identity.","operationId":"unlink_identity_api_profile_identities__identity_id__delete","parameters":[{"name":"identity_id","in":"path","required":true,"schema":{"type":"string","title":"Identity Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/profile/handle":{"put":{"tags":["identities"],"summary":"Update My Handle","description":"Set the requesting user's global handle @alice (plan 070).\n\nValidates grammar + reserved words, enforces global uniqueness, and records the previous handle in\nuser_handle_history (redirect + reclaim cool-down). One handle per person — not workspace-scoped.","operationId":"update_my_handle_api_profile_handle_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/whatsapp-otp/status":{"get":{"tags":["whatsapp-otp"],"summary":"Whatsapp Status","description":"Returns whether WhatsApp OTP is configured on this server.","operationId":"whatsapp_status_api_auth_whatsapp_otp_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppOtpStatusResponse"}}}}}}},"/api/auth/whatsapp-otp/send":{"post":{"tags":["whatsapp-otp"],"summary":"Send Otp","description":"Send a WhatsApp OTP to the given phone number. Always returns 200.","operationId":"send_otp_api_auth_whatsapp_otp_send_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendOTPRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppOtpSendResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/whatsapp-otp/verify":{"post":{"tags":["whatsapp-otp"],"summary":"Verify Otp","description":"Verify a WhatsApp OTP.\n\n- If Authorization header present: link phone to current user, return { linked: true }\n- If no Authorization header: login or register, return { token_hash, type, is_new_user }","operationId":"verify_otp_api_auth_whatsapp_otp_verify_post","parameters":[{"name":"authorization","in":"query","required":false,"schema":{"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyOTPRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppOtpVerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/tokens":{"post":{"tags":["tokens"],"summary":"Create Token","operationId":"create_token_api_auth_tokens_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["tokens"],"summary":"List Tokens","operationId":"list_tokens_api_auth_tokens_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TokenOut"},"title":"Response List Tokens Api Auth Tokens Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/tokens/{token_id}":{"delete":{"tags":["tokens"],"summary":"Revoke Token","operationId":"revoke_token_api_auth_tokens__token_id__delete","parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Token Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/pat/resolve":{"post":{"tags":["tokens"],"summary":"Resolve Pat","description":"Service endpoint — onsuite_auth calls this when a request arrives with an ``onst_pat_`` bearer.\nValidates the token (hash, expiry, revoke, binding) then intersects its scope cap with the owner's\nlive RBAC for the requested app+company. The PAT itself is the primary secret; ``pat_resolve_secret``\n(X-Service-Token) is optional defense-in-depth when configured.","operationId":"resolve_pat_api_auth_pat_resolve_post","parameters":[{"name":"x-service-token","in":"header","required":false,"schema":{"type":"string","title":"X-Service-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatResolveIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatResolveOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connections/invite":{"post":{"tags":["connections"],"summary":"Create Invite","operationId":"create_invite_api_connections_invite_post","parameters":[{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connections/claim":{"post":{"tags":["connections"],"summary":"Claim","operationId":"claim_api_connections_claim_post","parameters":[{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connections":{"get":{"tags":["connections"],"summary":"List Connections","operationId":"list_connections_api_connections_get","parameters":[{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connections/authorize":{"post":{"tags":["connections"],"summary":"Authorize","description":"Does `owner` expose `capability` to `peer`? Reads the DATA OWNER's edge (Model 2) — the exposer's\ndecision lives in its own tenant. The caller must be an active member of either side (party to the\nconnection); app backends call this with the acting user's forwarded JWT. (Phase 2 — sibling to the\nPAT resolver; service-account principals come when the first machine-to-machine flow needs them.)","operationId":"authorize_api_connections_authorize_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connections/invites/{invite_id}":{"delete":{"tags":["connections"],"summary":"Revoke Invite","operationId":"revoke_invite_api_connections_invites__invite_id__delete","parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invite Id"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connections/invites/{invite_id}/revoke":{"post":{"tags":["connections"],"summary":"Revoke Invite","operationId":"revoke_invite_api_connections_invites__invite_id__revoke_post","parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invite Id"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connections/{conn_id}/grants":{"post":{"tags":["connections"],"summary":"Upsert Grant","operationId":"upsert_grant_api_connections__conn_id__grants_post","parameters":[{"name":"conn_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conn Id"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUpsert"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connections/{conn_id}/grants/{capability}":{"delete":{"tags":["connections"],"summary":"Revoke Grant","operationId":"revoke_grant_api_connections__conn_id__grants__capability__delete","parameters":[{"name":"conn_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conn Id"}},{"name":"capability","in":"path","required":true,"schema":{"type":"string","title":"Capability"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connections/{conn_id}/accept":{"post":{"tags":["connections"],"summary":"Accept Edge","operationId":"accept_edge_api_connections__conn_id__accept_post","parameters":[{"name":"conn_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conn Id"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/connections/{conn_id}/decline":{"post":{"tags":["connections"],"summary":"Decline Edge","operationId":"decline_edge_api_connections__conn_id__decline_post","parameters":[{"name":"conn_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conn Id"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/storage/{app_slug}/upload":{"post":{"tags":["storage"],"summary":"Upload Object","description":"Upload a file to the app's bucket, scoped to the caller's company. Returns a signed URL.","operationId":"upload_object_api_storage__app_slug__upload_post","parameters":[{"name":"app_slug","in":"path","required":true,"schema":{"type":"string","title":"App Slug"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_object_api_storage__app_slug__upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/storage/{app_slug}/sign":{"post":{"tags":["storage"],"summary":"Sign Object","description":"Mint a fresh signed URL for an existing object.\n\nTwo callers: (a) a user in the object's company (JWT + X-Company-ID, company-scoped), or\n(b) a trusted child backend that already authorized cross-party access (X-Service-Token) —\ne.g. onclock-api signing a worker's signature for the hirer after checking engagement membership.","operationId":"sign_object_api_storage__app_slug__sign_post","parameters":[{"name":"app_slug","in":"path","required":true,"schema":{"type":"string","title":"App Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"X-Service-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Service-Token"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Company-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PathRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/storage/{app_slug}":{"delete":{"tags":["storage"],"summary":"Delete Object","description":"Delete an object in the caller's company scope.","operationId":"delete_object_api_storage__app_slug__delete","parameters":[{"name":"app_slug","in":"path","required":true,"schema":{"type":"string","title":"App Slug"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PathRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs":{"post":{"tags":["jobs"],"summary":"Create Job","operationId":"create_job_api_jobs_post","parameters":[{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreateIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["jobs"],"summary":"List Jobs","description":"List jobs for the active company. `ref` finds a scope's jobs (resume/isolation); `parent_id`\nlists a job's children; newest first.","operationId":"list_jobs_api_jobs_get","parameters":[{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"ref","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref"}},{"name":"parent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JobOut"},"title":"Response List Jobs Api Jobs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}":{"patch":{"tags":["jobs"],"summary":"Update Job","operationId":"update_job_api_jobs__job_id__patch","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-Service-Token","in":"header","required":false,"schema":{"type":"string","title":"X-Service-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["jobs"],"summary":"Get Job","operationId":"get_job_api_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/claim":{"post":{"tags":["jobs"],"summary":"Claim Job","description":"Lease the next due job the worker can run via FOR UPDATE SKIP LOCKED (atomic; concurrent workers\nskip each other's rows), filtered to the worker's registered (module, kind) handlers. Returns the\nleased job or null. The worker runs it and calls PATCH (heartbeat) then /finish.","operationId":"claim_job_api_jobs_claim_post","parameters":[{"name":"X-Service-Token","in":"header","required":false,"schema":{"type":"string","title":"X-Service-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobClaimIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/JobOut"},{"type":"null"}],"title":"Response Claim Job Api Jobs Claim Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/finish":{"post":{"tags":["jobs"],"summary":"Finish Job","description":"Terminal transition for a leased job. done → done; error → error (dead-letter);\nretry → requeued with backoff if attempts<max_attempts, else error.","operationId":"finish_job_api_jobs__job_id__finish_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-Service-Token","in":"header","required":false,"schema":{"type":"string","title":"X-Service-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobFinishIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/sweep":{"post":{"tags":["jobs"],"summary":"Sweep","description":"Cron entrypoint (call ~every minute). Reaps stale-lease 'running' jobs (crash recovery) and\nmaterializes due schedules into queued jobs (single-flight via the unique-in-flight index).","operationId":"sweep_api_jobs_sweep_post","parameters":[{"name":"X-Service-Token","in":"header","required":false,"schema":{"type":"string","title":"X-Service-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SweepOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/enqueue":{"post":{"tags":["jobs"],"summary":"Enqueue Job","description":"Enqueue a job with the service token (trusted internal caller — explicit company_id, no\nmembership check). 409 if one is already in flight for the same scope (single-flight), unless\nref_policy='queue', which joins the ref's FIFO queue instead.","operationId":"enqueue_job_api_jobs_enqueue_post","parameters":[{"name":"X-Service-Token","in":"header","required":false,"schema":{"type":"string","title":"X-Service-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobEnqueueIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/search":{"post":{"tags":["jobs"],"summary":"Search Jobs","description":"List jobs (service token; cross-company). POST-for-query avoids the GET /{job_id} path clash.","operationId":"search_jobs_api_jobs_search_post","parameters":[{"name":"X-Service-Token","in":"header","required":false,"schema":{"type":"string","title":"X-Service-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JobOut"},"title":"Response Search Jobs Api Jobs Search Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/purge":{"post":{"tags":["jobs"],"summary":"Purge Jobs","description":"Delete finished/failed jobs matching a scope (never touches a 'running' job). Dev/ops cleanup.","operationId":"purge_jobs_api_jobs_purge_post","parameters":[{"name":"X-Service-Token","in":"header","required":false,"schema":{"type":"string","title":"X-Service-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobPurgeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/notify/store-ready":{"post":{"tags":["internal"],"summary":"Store Ready","operationId":"store_ready_api_internal_notify_store_ready_post","parameters":[{"name":"x-service-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Service-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreNotifyIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/job-schedules":{"post":{"tags":["jobs"],"summary":"Create Schedule","operationId":"create_schedule_api_job_schedules_post","parameters":[{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["jobs"],"summary":"List Schedules","operationId":"list_schedules_api_job_schedules_get","parameters":[{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleOut"},"title":"Response List Schedules Api Job Schedules Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/job-schedules/{sched_id}":{"patch":{"tags":["jobs"],"summary":"Update Schedule","operationId":"update_schedule_api_job_schedules__sched_id__patch","parameters":[{"name":"sched_id","in":"path","required":true,"schema":{"type":"string","title":"Sched Id"}},{"name":"enabled","in":"query","required":true,"schema":{"type":"boolean","title":"Enabled"}},{"name":"X-Company-ID","in":"header","required":false,"schema":{"type":"string","title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/job-schedules/upsert":{"post":{"tags":["jobs"],"summary":"Upsert Schedule","description":"Create or update the schedule for a scope (idempotent on company_id+ref) — also the toggle path\n(pass enabled; interval_seconds may be omitted on update). Service token; explicit company_id.","operationId":"upsert_schedule_api_job_schedules_upsert_post","parameters":[{"name":"X-Service-Token","in":"header","required":false,"schema":{"type":"string","title":"X-Service-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleUpsertIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/job-schedules/search":{"post":{"tags":["jobs"],"summary":"Search Schedules","operationId":"search_schedules_api_job_schedules_search_post","parameters":[{"name":"X-Service-Token","in":"header","required":false,"schema":{"type":"string","title":"X-Service-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleSearchIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleOut"},"title":"Response Search Schedules Api Job Schedules Search Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/apps":{"get":{"tags":["public-apps"],"summary":"List Public Apps","operationId":"list_public_apps_public_apps_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PublicAppListItem"},"type":"array","title":"Response List Public Apps Public Apps Get"}}}}}}},"/public/apps/{slug}":{"get":{"tags":["public-apps"],"summary":"Get Public App","operationId":"get_public_app_public_apps__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAppResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/profiles/{address}":{"get":{"tags":["public-profiles"],"summary":"Get Public Profile","description":"The published profile + its ordered visible blocks. 404 for anything not published.\n\n`address` is @alice, @ws:acme, or a bare workspace slug (phase-1 form).","operationId":"get_public_profile_public_profiles__address__get","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string","title":"Address"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/profiles/{address}/blocks/{block_id}":{"get":{"tags":["public-profiles"],"summary":"Get Public Profile Block","description":"Single-block hydrate — the fetch app-powered widgets will use (phase 3). Static-safe today.","operationId":"get_public_profile_block_public_profiles__address__blocks__block_id__get","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string","title":"Address"}},{"name":"block_id","in":"path","required":true,"schema":{"type":"string","title":"Block Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/profile":{"get":{"tags":["profile"],"summary":"Get Profile","description":"The workspace's profile (or defaults if none yet) + ALL blocks, hidden included.","operationId":"get_profile_api_profile_get","parameters":[{"name":"x-company-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["profile"],"summary":"Update Profile","description":"Upsert the profile fields. Only fields present in the body change (partial update).","operationId":"update_profile_api_profile_put","parameters":[{"name":"x-company-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyProfileUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/profile/blocks":{"post":{"tags":["profile"],"summary":"Create Block","operationId":"create_block_api_profile_blocks_post","parameters":[{"name":"x-company-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileBlockCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/profile/blocks/reorder":{"put":{"tags":["profile"],"summary":"Reorder Blocks","description":"Set positions 10, 20, … following the given id order. Ids not listed keep their position.","operationId":"reorder_blocks_api_profile_blocks_reorder_put","parameters":[{"name":"x-company-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileBlocksReorder"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/profile/blocks/{block_id}":{"put":{"tags":["profile"],"summary":"Update Block","operationId":"update_block_api_profile_blocks__block_id__put","parameters":[{"name":"block_id","in":"path","required":true,"schema":{"type":"string","title":"Block Id"}},{"name":"x-company-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileBlockUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["profile"],"summary":"Delete Block","operationId":"delete_block_api_profile_blocks__block_id__delete","parameters":[{"name":"block_id","in":"path","required":true,"schema":{"type":"string","title":"Block Id"}},{"name":"x-company-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Company-Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/apps/{app_slug}/plans":{"get":{"tags":["billing"],"summary":"List App Plans","description":"Public plan catalog for pricing pages/pickers — is_public+active rows only. No auth:\nthis is display data (the same numbers the marketing page prints).","operationId":"list_app_plans_api_apps__app_slug__plans_get","parameters":[{"name":"app_slug","in":"path","required":true,"schema":{"type":"string","title":"App Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/service/entitlements":{"get":{"tags":["billing"],"summary":"Service Entitlements","description":"Plan + entitlements for a workspace, for SERVER-TO-SERVER callers with no user context —\ne.g. onPlay's public watch pages rendering '7 of 10 free games used' to the whole group\n(onplay#014 5th rev). Guarded by the plan-058 service secret (STORAGE_SERVICE_TOKEN — the\nexisting platform↔child-api shared secret; naming is historical). Read-only and low-\nsensitivity, but not anonymous: plan shape is group-visible on watch pages anyway.","operationId":"service_entitlements_api_service_entitlements_get","parameters":[{"name":"app_slug","in":"query","required":true,"schema":{"type":"string","title":"App Slug"}},{"name":"company_id","in":"query","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"x-service-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Service-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/service/billing/checkout":{"post":{"tags":["billing"],"summary":"Service Checkout","description":"Checkout WITHOUT a signed-in user (onplay#014 6th rev): the caller (a child API) has\nalready authorized via its own token scope — e.g. onPlay's watch link, which names exactly\none workspace — and the payer is whoever in the group holds the link.\n\n'order' → a one-time PASS (pay once, Pro until date, no mandate; needs only core Payments).\n'subscription' → auto-renew; the mandate lands on the PAYER's own UPI (Razorpay Checkout\ncollects their contact). The organizer can cancel in-app (cancel is workspace-scoped) and\nthe payer can revoke from their UPI app — both sides keep an exit.\n\nGuards: nothing anonymous stacks on a live auto-renew mandate, and anonymous subscription\ncheckout requires NO live plan at all (plan changes are admin territory).","operationId":"service_checkout_api_service_billing_checkout_post","parameters":[{"name":"x-service-token","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Service-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceCheckoutIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/checkout":{"post":{"tags":["billing"],"summary":"Create Checkout","description":"Create the Razorpay customer + subscription for a workspace and return what Checkout JS\nneeds. The subscriptions row is NOT written here — the webhook writes it on activation.\n\nUpgrade path: a live Razorpay subscription on a different plan is moved via Razorpay's\nplan-change (prorated); the webhook's subscription.updated then syncs our row. A live\nmanual grant is simply superseded when the new subscription activates (same-row upsert).","operationId":"create_checkout_api_billing_checkout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/cancel":{"post":{"tags":["billing"],"summary":"Cancel Subscription","description":"Schedule cancellation at cycle end (the paid period runs out, then free caps). The row\nflips when the subscription.cancelled webhook lands.","operationId":"cancel_subscription_api_billing_cancel_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/webhook":{"post":{"tags":["billing"],"summary":"Razorpay Webhook","operationId":"razorpay_webhook_api_billing_webhook_post","parameters":[{"name":"x-razorpay-signature","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Razorpay-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/me":{"get":{"tags":["platform-admin"],"summary":"Admin Me","description":"The onsuite-admin console's gate: who am I on the admin plane? 403 for everyone without a\nplatform_admins row — deliberately a SEPARATE endpoint from /api/auth/me, whose tenant\nbootstrap has no business revealing that the plane exists (plan 086 phase 1).","operationId":"admin_me_api_admin_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscriptions":{"get":{"tags":["platform-admin"],"summary":"List Subscriptions","operationId":"list_subscriptions_api_admin_subscriptions_get","parameters":[{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/plans":{"get":{"tags":["platform-admin"],"summary":"List Plans","description":"Operator view — includes provider_plan_id so the Razorpay mirror status is visible.","operationId":"list_plans_api_admin_plans_get","parameters":[{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/overview":{"get":{"tags":["platform-admin"],"summary":"Overview","description":"Operator dashboard: tenant/user counts, 7-day signups, installs per app, live plans + MRR.\nMRR counts provider='razorpay' rows only — manual grants are goodwill, not revenue.\napp_slug (plan 088 app context) scopes everything to workspaces with that app active;\nusers_7d is signup-attribution-free, so it nulls out under an app filter (same pattern as\nthe scoped-admin guard).","operationId":"overview_api_admin_overview_get","parameters":[{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces":{"get":{"tags":["platform-admin"],"summary":"List Workspaces","operationId":"list_workspaces_api_admin_workspaces_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{company_id}":{"get":{"tags":["platform-admin"],"summary":"Workspace Detail","operationId":"workspace_detail_api_admin_workspaces__company_id__get","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users":{"get":{"tags":["platform-admin"],"summary":"List Users","description":"Global directory INCLUDING suspended/inactive — the tenant-facing /api/lookup hides them.\napp_slug (plan 088): members of workspaces where that app is active.","operationId":"list_users_api_admin_users_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{user_id}":{"get":{"tags":["platform-admin"],"summary":"User Detail","operationId":"user_detail_api_admin_users__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/apps":{"get":{"tags":["platform-admin"],"summary":"List Apps Admin","operationId":"list_apps_admin_api_admin_apps_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/apps/{slug}":{"get":{"tags":["platform-admin"],"summary":"App Detail","operationId":"app_detail_api_admin_apps__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/audit":{"get":{"tags":["platform-admin"],"summary":"List Audit","description":"The log. `action` filters by prefix ('subscription.' matches grant + expire).\napp_slug (plan 088) is BEST-EFFORT: matches payload->>'app_slug' (impersonations,\nuninstalls, grants), app-target rows, and '<slug>/…' labels (provider mirrors) — plane-level\nactions (user.suspend, admin.grant…) are not app-attributable and only show unfiltered.","operationId":"list_audit_api_admin_audit_get","parameters":[{"name":"actor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"}},{"name":"target_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Type"}},{"name":"target_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Id"}},{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/plans/provider":{"put":{"tags":["platform-admin"],"summary":"Set Provider Plan","operationId":"set_provider_plan_api_admin_plans_provider_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderPlanIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{company_id}/suspend":{"post":{"tags":["platform-admin"],"summary":"Suspend Workspace","operationId":"suspend_workspace_api_admin_workspaces__company_id__suspend_post","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{company_id}/restore":{"post":{"tags":["platform-admin"],"summary":"Restore Workspace","operationId":"restore_workspace_api_admin_workspaces__company_id__restore_post","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{user_id}/suspend":{"post":{"tags":["platform-admin"],"summary":"Suspend User","operationId":"suspend_user_api_admin_users__user_id__suspend_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{user_id}/restore":{"post":{"tags":["platform-admin"],"summary":"Restore User","operationId":"restore_user_api_admin_users__user_id__restore_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{user_id}/delete":{"post":{"tags":["platform-admin"],"summary":"Delete User","description":"Admin-rail account deletion — SAME semantics as self-serve DELETE /api/auth/account\n(anonymize + revoke via scrub_user_account: PII scrubbed, solo-owned workspaces deleted\nwith their app data, memberships/identities dropped, credential killed). Irreversible;\nreason is mandatory and the audit row is written in the same transaction.","operationId":"delete_user_api_admin_users__user_id__delete_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{company_id}/apps/{slug}/uninstall":{"post":{"tags":["platform-admin"],"summary":"Force Uninstall","description":"Support force-uninstall — same semantics as the tenant flow (status='uninstalled',\nnothing deleted), minus the owner requirement, plus the audit row.\n\nUninstalling the ADMIN PLANE'S OWN APP is root-only (STUDIO-152 security review). It is not an\nordinary lifecycle action: emptying `onsuite-admin`'s home list is what disarms the one-home 409\nthat otherwise stops the plane being re-homed into a workspace somebody else owns, so it was\nstep 1 of an escalation chain ending in root. It also locks every admin out of the console,\nwhich is not a call a non-root operator should be able to make alone.","operationId":"force_uninstall_api_admin_workspaces__company_id__apps__slug__uninstall_post","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{company_id}/platform":{"post":{"tags":["platform-admin"],"summary":"Set Platform Workspace","description":"Designate (or undesignate) a workspace as a PLATFORM workspace. Root-only.\n\nRoot rather than `admin.lifecycle.manage`, because this is a privilege-TOPOLOGY write, not a\ntenant lifecycle one: a platform workspace is where platform apps may live, and one of those\napps (`onsuite-admin`) is the app that grants root. `_require_root` IS the `admin.plane.manage`\ngate — is_root is defined as that action or the superuser role.\n\n**Undesignation refuses while any platform app is still active here.** Dropping the flag under a\nlive install would strand it: every resolver of \"where does this platform app live\" filters on\n`is_platform_workspace`, so the row would survive while becoming invisible to sign-in, to RBAC\nand to the admin plane — a worse bug than the one this card fixes. Uninstall first.","operationId":"set_platform_workspace_api_admin_workspaces__company_id__platform_post","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformFlagIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/workspaces/{company_id}/apps/{slug}/install":{"post":{"tags":["platform-admin"],"summary":"Force Install","description":"Activate a PLATFORM app in a platform workspace — the product path that makes a second home\nexist. Audited, with no owner requirement on the CALLER (the admin is acting on the workspace,\nnot joining it).\n\n**ROOT, not `admin.lifecycle.manage`** — the plan specified the latter for symmetry with\n`force_uninstall`, and the security review this card owes (criterion 5) found that symmetry is\nthe wrong one. `set_platform_workspace` above is root-gated because \"a platform workspace is\nwhere platform apps may live, and one of those apps (`onsuite-admin`) is the app that grants\nroot\" — and THIS is the call that actually places an app there. Placing `onsuite-admin` grants\nits `owner` role, which is `is_superuser`, which `_admin_scope` reads as `is_root`. So at the\nlifecycle gate a non-root `operator` (which holds `admin.lifecycle.manage` and not\n`admin.plane.manage`) could: force-uninstall `onsuite-admin` from its only home, which empties\nthe home list and so disarms the one-home 409, then install it into a workspace whose owner they\ncontrol — minting a platform root admin. Designation and activation are two halves of one\nprivilege-topology write and must carry the same gate.\n\nPlatform apps only, deliberately. A tenant app is installed by its workspace's owner through\n`/api/apps/{slug}/install`, and an admin-plane shortcut around that owner gate is a different\ncard with different consequences — this one exists because platform apps have no owner-facing\ninstall path at all.\n\nThe app's `owner` role goes to the WORKSPACE OWNER, not to the admin who clicked: the admin is\nprovisioning, not taking a seat. Both the guard and the activation are `apps.py`'s own\nfunctions, so this path cannot drift from the tenant one.","operationId":"force_install_api_admin_workspaces__company_id__apps__slug__install_post","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/apps/{slug}/status":{"put":{"tags":["platform-admin"],"summary":"Set App Status","description":"published | draft | deprecated. Not published ⇒ hidden from the marketplace AND\n/api/sso/launch refuses it (sso.py resolves status='published' only) — this pulls an app\nwithout a redeploy. Existing installs keep their data; nothing is uninstalled.","operationId":"set_app_status_api_admin_apps__slug__status_put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppStatusIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/platform-admins":{"get":{"tags":["platform-admin"],"summary":"List Platform Admins","description":"Resolved admin roster (phase 8b): everyone holding an onsuite-admin role in the platform\nworkspace, with their role keys + optional resource scope. Membership/roles are managed via\nthe platform workspace's Team page (the standard invite flow) — this plane only edits the\nRESOURCE scope rows. Root-only.\n\nScoped to onsuite-admin's OWN home(s), not to `is_platform_workspace` at large (STUDIO-152):\nwith a second platform workspace existing for another app, \"holds an onsuite-admin role in a\nplatform workspace\" would start counting workspaces this plane does not live in.","operationId":"list_platform_admins_api_admin_platform_admins_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["platform-admin"],"summary":"Set Admin Scope","description":"Upsert an admin's RESOURCE scope (root-only). Grants no membership/role by itself —\ninvite them to the platform workspace with an onsuite-admin role first (Team page).","operationId":"set_admin_scope_api_admin_platform_admins_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminScopeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/platform-admins/{user_id}":{"delete":{"tags":["platform-admin"],"summary":"Revoke Platform Admin","description":"Revoke a user's onsuite-admin roles + scope row (root-only). Refuses to strip the LAST\nroot-capable admin. Note: the platform workspace OWNER is root via lazy owner auto-assign —\nde-rooting them requires changing the workspace owner, not this endpoint.","operationId":"revoke_platform_admin_api_admin_platform_admins__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/impersonate/data":{"post":{"tags":["platform-admin"],"summary":"Impersonate Data","operationId":"impersonate_data_api_admin_impersonate_data_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImpersonateDataIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/impersonate/end":{"post":{"tags":["platform-admin"],"summary":"Impersonate Data End","operationId":"impersonate_data_end_api_admin_impersonate_end_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImpersonateEndIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/impersonate/ui":{"post":{"tags":["platform-admin"],"summary":"Impersonate Ui","description":"Mint a REAL session for the target, marked by the `act` claim the token hook stamps when\nit binds the pending grant (mig 067). The magiclink is exchanged SERVER-SIDE (that mint is\nwhere the grant binds) and SSOPage gets `token=<target access token>` — its documented\nfallback path. Revocation is enforced per-request in get_auth_user + the oracle.","operationId":"impersonate_ui_api_admin_impersonate_ui_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImpersonateUiIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/impersonate/ui/reopen":{"post":{"tags":["platform-admin"],"summary":"Impersonate Ui Reopen","description":"Re-mint a session for a LIVE grant (24h TTL vs the 1h access-token life): the grant is\nreset to pending (single-use binding preserved — the fresh mint binds it anew) and a fresh\nlaunch URL is returned. The console viewer calls this on every session open.","operationId":"impersonate_ui_reopen_api_admin_impersonate_ui_reopen_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImpersonateReopenIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/impersonate/end-all":{"post":{"tags":["platform-admin"],"summary":"Impersonate End All","description":"End EVERY live impersonation grant of the calling admin — wired to the console's sign-out\n(operator decision 2026-08-13: admin logout ends all their sessions).","operationId":"impersonate_end_all_api_admin_impersonate_end_all_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/impersonate/ui/end":{"post":{"tags":["platform-admin"],"summary":"Impersonate Ui End","operationId":"impersonate_ui_end_api_admin_impersonate_ui_end_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImpersonateUiEndIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscriptions/grant":{"post":{"tags":["platform-admin"],"summary":"Grant Subscription","operationId":"grant_subscription_api_admin_subscriptions_grant_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscriptions/expire":{"post":{"tags":["platform-admin"],"summary":"Expire Subscription","description":"Revoke a live subscription row (manual grants; or emergency for a razorpay row — that\ndoes NOT cancel the provider mandate, use billing/cancel for the customer flow).","operationId":"expire_subscription_api_admin_subscriptions_expire_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpireIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/overrides":{"put":{"tags":["platform-admin"],"summary":"Set Override","operationId":"set_override_api_admin_overrides_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverrideIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/waitlist":{"get":{"tags":["platform-admin"],"summary":"List Waitlist","description":"Newest first. `registered` says whether the apps catalog knows the slug — the console shows an\n'unregistered' badge rather than refusing a pre-launch app.","operationId":"list_waitlist_api_admin_waitlist_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"env","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"production","title":"Env"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/waitlist/summary":{"get":{"tags":["platform-admin"],"summary":"Waitlist Summary","description":"Per app: total · last 7 days · most recent signup — the 'which apps are people interested\nin' strip at the top of the console page.","operationId":"waitlist_summary_api_admin_waitlist_summary_get","parameters":[{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"env","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"production","title":"Env"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/waitlist/export.csv":{"get":{"tags":["platform-admin"],"summary":"Export Waitlist Csv","description":"The current filter as CSV. metadata is flattened into `metadata.<key>` columns (the union of\nkeys across the export) so per-app answers land in their own column, not a JSON blob.","operationId":"export_waitlist_csv_api_admin_waitlist_export_csv_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"app_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},{"name":"env","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"production","title":"Env"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/waitlist/{row_id}":{"delete":{"tags":["platform-admin"],"summary":"Delete Waitlist Row","description":"Remove one signup — test cleanup, or a privacy request. Audited in the same transaction;\nthe row's id rides in payload because the audit target_id column is a UUID.","operationId":"delete_waitlist_row_api_admin_waitlist__row_id__delete","parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"integer","title":"Row Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/waitlist":{"post":{"tags":["waitlist"],"summary":"Join Waitlist","operationId":"join_waitlist_public_waitlist_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistIn"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistAccepted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/fleet/enroll":{"post":{"tags":["fleet"],"summary":"Fleet Enroll","description":"Exchange an approved ``purpose=enroll`` device code for this host's board credentials.\n\nReturns RFC 8628 errors while the human has not acted, exactly as ``/sso/device/token`` does, so\none poll loop in the CLI drives both the wait and the result.","operationId":"fleet_enroll_api_fleet_enroll_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FleetEnrollIn"}}},"required":true},"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":"Health","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/api/version":{"get":{"summary":"Version","operationId":"version_api_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AcceptInviteRequest":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"AcceptInviteRequest"},"AcceptInviteResponse":{"properties":{"company":{"anyOf":[{"$ref":"#/components/schemas/CompanyResponse"},{"type":"null"}]},"role":{"type":"string","title":"Role"},"app_slug":{"type":"string","title":"App Slug"},"app_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Url"}},"type":"object","required":["role","app_slug"],"title":"AcceptInviteResponse"},"AdminScopeIn":{"properties":{"email":{"type":"string","title":"Email"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"allowed_apps":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Apps"},"allowed_companies":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Companies"}},"type":"object","required":["email"],"title":"AdminScopeIn"},"AppActionResponse":{"properties":{"id":{"type":"string","title":"Id"},"app_id":{"type":"string","title":"App Id"},"action_key":{"type":"string","title":"Action Key"},"action_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Label"},"resource":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","app_id","action_key","created_at"],"title":"AppActionResponse"},"AppActionsResponse":{"properties":{"actions":{"items":{"$ref":"#/components/schemas/AppActionResponse"},"type":"array","title":"Actions"}},"type":"object","required":["actions"],"title":"AppActionsResponse"},"AppInstallRequest":{"properties":{"app_id":{"type":"string","title":"App Id"}},"type":"object","required":["app_id"],"title":"AppInstallRequest"},"AppModuleOut":{"properties":{"module_key":{"type":"string","title":"Module Key"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"default_enabled":{"type":"boolean","title":"Default Enabled"},"sort":{"type":"integer","title":"Sort","default":0}},"type":"object","required":["module_key","default_enabled"],"title":"AppModuleOut"},"AppModulesResponse":{"properties":{"app_slug":{"type":"string","title":"App Slug"},"modules":{"items":{"$ref":"#/components/schemas/AppModuleOut"},"type":"array","title":"Modules"}},"type":"object","required":["app_slug","modules"],"title":"AppModulesResponse"},"AppResponse":{"properties":{"id":{"type":"string","title":"Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"api_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Base Url"},"ui_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ui Base Url"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"status":{"type":"string","title":"Status"},"is_platform":{"type":"boolean","title":"Is Platform","default":false},"config_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config Schema"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tagline"},"featured_rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Featured Rank"},"listing":{"additionalProperties":true,"type":"object","title":"Listing","default":{}}},"type":"object","required":["id","slug","name","description","icon","api_base_url","ui_base_url","category","status","created_at"],"title":"AppResponse"},"AppRoleAction":{"properties":{"action_key":{"type":"string","title":"Action Key"},"action_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Label"},"resource":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource"}},"type":"object","required":["action_key"],"title":"AppRoleAction"},"AppRoleAssign":{"properties":{"app_slug":{"type":"string","title":"App Slug"},"role_key":{"type":"string","title":"Role Key"}},"type":"object","required":["app_slug","role_key"],"title":"AppRoleAssign"},"AppRoleResponse":{"properties":{"id":{"type":"string","title":"Id"},"app_id":{"type":"string","title":"App Id"},"role_key":{"type":"string","title":"Role Key"},"role_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Label"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_default":{"type":"boolean","title":"Is Default","default":false},"hierarchy_level":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Hierarchy Level"},"is_superuser":{"type":"boolean","title":"Is Superuser","default":false},"actions":{"items":{"$ref":"#/components/schemas/AppRoleAction"},"type":"array","title":"Actions","default":[]},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","app_id","role_key","created_at"],"title":"AppRoleResponse"},"AppRolesResponse":{"properties":{"roles":{"items":{"$ref":"#/components/schemas/AppRoleResponse"},"type":"array","title":"Roles"}},"type":"object","required":["roles"],"title":"AppRolesResponse"},"AppStatusIn":{"properties":{"status":{"type":"string","title":"Status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["status"],"title":"AppStatusIn"},"AppsListResponse":{"properties":{"apps":{"items":{"$ref":"#/components/schemas/AppResponse"},"type":"array","title":"Apps"}},"type":"object","required":["apps"],"title":"AppsListResponse"},"AuthMeResponse":{"properties":{"user":{"$ref":"#/components/schemas/UserResponse"},"companies":{"items":{"$ref":"#/components/schemas/BootstrapCompany"},"type":"array","title":"Companies"},"currentCompany":{"anyOf":[{"$ref":"#/components/schemas/BootstrapCompany"},{"type":"null"}]},"installedApps":{"items":{"$ref":"#/components/schemas/InstalledAppResponse"},"type":"array","title":"Installedapps","default":[]},"pendingInvitations":{"items":{"$ref":"#/components/schemas/PendingInvitationResponse"},"type":"array","title":"Pendinginvitations","default":[]}},"type":"object","required":["user","companies"],"title":"AuthMeResponse","description":"The platform bootstrap contract — consumed by @onsuite/lib auth-context in every app."},"AuthorizeIn":{"properties":{"owner_company_id":{"type":"string","format":"uuid","title":"Owner Company Id"},"peer_company_id":{"type":"string","format":"uuid","title":"Peer Company Id"},"capability":{"type":"string","maxLength":100,"minLength":1,"title":"Capability"},"resource_ref":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Resource Ref"}},"type":"object","required":["owner_company_id","peer_company_id","capability"],"title":"AuthorizeIn"},"BatchPermissionsEntry":{"properties":{"company_id":{"type":"string","title":"Company Id"},"is_superuser":{"type":"boolean","title":"Is Superuser","default":false},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions","default":[]},"modules":{"items":{"type":"string"},"type":"array","title":"Modules","default":[]},"plan":{"anyOf":[{"$ref":"#/components/schemas/PlanInfo"},{"type":"null"}]},"entitlements":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"null"}]},"type":"object"},{"type":"null"}],"title":"Entitlements"}},"type":"object","required":["company_id"],"title":"BatchPermissionsEntry","description":"One workspace the caller is an ACTIVE MEMBER of. A workspace absent from the batch\nresponse means the caller is not an active member there — the batch equivalent of the\nsingle endpoint's 403, so callers must fail closed on absence."},"BatchPermissionsResponse":{"properties":{"app_slug":{"type":"string","title":"App Slug"},"results":{"items":{"$ref":"#/components/schemas/BatchPermissionsEntry"},"type":"array","title":"Results"}},"type":"object","required":["app_slug","results"],"title":"BatchPermissionsResponse"},"Body_upload_object_api_storage__app_slug__upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prefix"}},"type":"object","required":["file"],"title":"Body_upload_object_api_storage__app_slug__upload_post"},"BootstrapCompany":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"type":{"type":"string","title":"Type"},"owner_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner User Id"},"status":{"type":"string","title":"Status"},"is_platform_workspace":{"type":"boolean","title":"Is Platform Workspace","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"is_default":{"type":"boolean","title":"Is Default","default":false},"installedApps":{"items":{"$ref":"#/components/schemas/InstalledAppResponse"},"type":"array","title":"Installedapps","default":[]}},"type":"object","required":["id","name","description","website","type","owner_user_id","status","created_at","updated_at"],"title":"BootstrapCompany","description":"Company as returned by /api/auth/me — includes its installed apps."},"CancelIn":{"properties":{"app_slug":{"type":"string","title":"App Slug"},"company_id":{"type":"string","title":"Company Id"}},"type":"object","required":["app_slug","company_id"],"title":"CancelIn"},"ChangePasswordRequest":{"properties":{"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["new_password"],"title":"ChangePasswordRequest"},"CheckoutIn":{"properties":{"app_slug":{"type":"string","title":"App Slug"},"plan_slug":{"type":"string","title":"Plan Slug"},"interval":{"type":"string","title":"Interval","default":"month"},"company_id":{"type":"string","title":"Company Id"}},"type":"object","required":["app_slug","plan_slug","company_id"],"title":"CheckoutIn"},"ClaimIn":{"properties":{"token":{"type":"string","title":"Token"},"grant":{"items":{"type":"string"},"type":"array","title":"Grant","default":[]}},"type":"object","required":["token"],"title":"ClaimIn"},"CompaniesListResponse":{"properties":{"companies":{"items":{"$ref":"#/components/schemas/CompanyResponse"},"type":"array","title":"Companies"}},"type":"object","required":["companies"],"title":"CompaniesListResponse"},"CompanyCreate":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name"],"title":"CompanyCreate"},"CompanyDetailResponse":{"properties":{"company":{"$ref":"#/components/schemas/CompanyResponse"},"memberCount":{"type":"integer","title":"Membercount"},"installedAppCount":{"type":"integer","title":"Installedappcount"}},"type":"object","required":["company","memberCount","installedAppCount"],"title":"CompanyDetailResponse"},"CompanyEnvelope":{"properties":{"company":{"$ref":"#/components/schemas/CompanyResponse"}},"type":"object","required":["company"],"title":"CompanyEnvelope"},"CompanyModuleState":{"properties":{"module_key":{"type":"string","title":"Module Key"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"enabled":{"type":"boolean","title":"Enabled"},"default_enabled":{"type":"boolean","title":"Default Enabled"},"overridden":{"type":"boolean","title":"Overridden"}},"type":"object","required":["module_key","enabled","default_enabled","overridden"],"title":"CompanyModuleState","description":"Effective per-workspace state: enabled = COALESCE(override, default_enabled);\noverridden = an explicit company_app_modules row exists."},"CompanyModulesResponse":{"properties":{"company_id":{"type":"string","title":"Company Id"},"app_slug":{"type":"string","title":"App Slug"},"modules":{"items":{"$ref":"#/components/schemas/CompanyModuleState"},"type":"array","title":"Modules"}},"type":"object","required":["company_id","app_slug","modules"],"title":"CompanyModulesResponse"},"CompanyProfileUpdate":{"properties":{"tagline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tagline"},"bio":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bio"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"},"skills":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Skills"},"open_for_business":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Open For Business"},"is_public":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Public"},"theme":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Theme"}},"type":"object","title":"CompanyProfileUpdate","description":"Partial update of a workspace's PUBLIC profile (company_profiles) — only fields present\nchange. NOT the platform user-profile model: that's ProfileUpdate (name/phone) near the top,\nbound by PUT /api/auth/profile. The two collided under one name once (drift audit 2026-08-01,\nshadowed the auth model) — keep them distinct."},"CompanyResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"type":{"type":"string","title":"Type"},"owner_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner User Id"},"status":{"type":"string","title":"Status"},"is_platform_workspace":{"type":"boolean","title":"Is Platform Workspace","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"is_default":{"type":"boolean","title":"Is Default","default":false}},"type":"object","required":["id","name","description","website","type","owner_user_id","status","created_at","updated_at"],"title":"CompanyResponse"},"CompanyUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"status":{"anyOf":[{"type":"string","enum":["active","inactive"]},{"type":"null"}],"title":"Status"}},"type":"object","title":"CompanyUpdate"},"CreatedInvitation":{"properties":{"id":{"type":"string","title":"Id"},"invited_email":{"type":"string","title":"Invited Email"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"app_slug":{"type":"string","title":"App Slug"},"invite_url":{"type":"string","title":"Invite Url"},"share_url":{"type":"string","title":"Share Url","default":""},"email_sent":{"type":"boolean","title":"Email Sent","default":false}},"type":"object","required":["id","invited_email","role","status","app_slug","invite_url"],"title":"CreatedInvitation"},"CredentialMember":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"company_id":{"type":"string","title":"Company Id"},"company_name":{"type":"string","title":"Company Name"}},"type":"object","required":["user_id","email","name","role","company_id","company_name"],"title":"CredentialMember"},"CustomIdentity":{"properties":{"id":{"type":"string","title":"Id"},"provider":{"type":"string","title":"Provider"},"provider_id":{"type":"string","title":"Provider Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","provider","provider_id","created_at"],"title":"CustomIdentity"},"DeviceApproveIn":{"properties":{"user_code":{"type":"string","title":"User Code"},"company_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Id"}},"type":"object","required":["user_code"],"title":"DeviceApproveIn"},"DeviceAuthRequest":{"properties":{"app_slug":{"type":"string","title":"App Slug"},"client_name":{"type":"string","maxLength":120,"title":"Client Name"},"purpose":{"type":"string","enum":["signin","enroll"],"title":"Purpose","default":"signin"}},"type":"object","required":["app_slug","client_name"],"title":"DeviceAuthRequest","description":"Unauthenticated. `app_slug` plays the RFC's `client_id` role — a published catalog app is\nthe only thing we trust about the caller; `client_name` is free text shown on the consent\nscreen so a human can tell WHICH device is asking."},"DeviceAuthResponse":{"properties":{"device_code":{"type":"string","title":"Device Code"},"user_code":{"type":"string","title":"User Code"},"verification_uri":{"type":"string","title":"Verification Uri"},"expires_in":{"type":"integer","title":"Expires In"},"interval":{"type":"integer","title":"Interval"}},"type":"object","required":["device_code","user_code","verification_uri","expires_in","interval"],"title":"DeviceAuthResponse"},"DeviceCodeIn":{"properties":{"user_code":{"type":"string","title":"User Code"}},"type":"object","required":["user_code"],"title":"DeviceCodeIn","description":"The user_code travels in a POST body, never in a URL — it stays out of access logs,\nReferer headers and browser history."},"DeviceLookupResponse":{"properties":{"app_slug":{"type":"string","title":"App Slug"},"app_name":{"type":"string","title":"App Name"},"client_name":{"type":"string","title":"Client Name"},"user_code":{"type":"string","title":"User Code"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"purpose":{"type":"string","enum":["signin","enroll"],"title":"Purpose","default":"signin"},"workspace_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Name"},"consumer":{"type":"boolean","title":"Consumer","default":false}},"type":"object","required":["app_slug","app_name","client_name","user_code","expires_at"],"title":"DeviceLookupResponse"},"DeviceTokenIn":{"properties":{"device_code":{"type":"string","title":"Device Code"}},"type":"object","required":["device_code"],"title":"DeviceTokenIn"},"ExpireIn":{"properties":{"company_id":{"type":"string","title":"Company Id"},"app_slug":{"type":"string","title":"App Slug"}},"type":"object","required":["company_id","app_slug"],"title":"ExpireIn"},"FleetEnrollIn":{"properties":{"device_code":{"type":"string","title":"Device Code"},"host":{"type":"string","maxLength":63,"minLength":1,"title":"Host"},"identities":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Identities"}},"type":"object","required":["device_code","host"],"title":"FleetEnrollIn"},"GrantIn":{"properties":{"company_id":{"type":"string","title":"Company Id"},"app_slug":{"type":"string","title":"App Slug"},"plan_slug":{"type":"string","title":"Plan Slug"},"interval":{"type":"string","title":"Interval","default":"month"},"months":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Months"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["company_id","app_slug","plan_slug"],"title":"GrantIn"},"GrantUpsert":{"properties":{"capability":{"type":"string","maxLength":100,"minLength":1,"title":"Capability"},"status":{"type":"string","title":"Status","default":"granted"}},"type":"object","required":["capability"],"title":"GrantUpsert"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HandleResolveResponse":{"properties":{"kind":{"type":"string","title":"Kind"},"address":{"type":"string","title":"Address"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"handle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handle"},"company_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Id"},"company_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Slug"},"redirected":{"type":"boolean","title":"Redirected","default":false}},"type":"object","required":["kind","address"],"title":"HandleResolveResponse","description":"Resolve @alice → a user, or @ws:acme → a workspace (plan 070). Profile basics only (no email/phone)."},"HandleResponse":{"properties":{"handle":{"type":"string","title":"Handle"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"}},"type":"object","required":["handle"],"title":"HandleResponse"},"HandleSearchItem":{"properties":{"user_id":{"type":"string","title":"User Id"},"handle":{"type":"string","title":"Handle"},"address":{"type":"string","title":"Address"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"}},"type":"object","required":["user_id","handle","address"],"title":"HandleSearchItem"},"HandleSearchResponse":{"properties":{"handles":{"items":{"$ref":"#/components/schemas/HandleSearchItem"},"type":"array","title":"Handles","default":[]}},"type":"object","title":"HandleSearchResponse"},"HandleUpdate":{"properties":{"handle":{"type":"string","title":"Handle"}},"type":"object","required":["handle"],"title":"HandleUpdate"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"HealthResponse"},"IdentitiesResponse":{"properties":{"oauth_providers":{"items":{"type":"string"},"type":"array","title":"Oauth Providers","default":[]},"custom":{"items":{"$ref":"#/components/schemas/CustomIdentity"},"type":"array","title":"Custom","default":[]}},"type":"object","title":"IdentitiesResponse"},"ImpersonateDataIn":{"properties":{"user_id":{"type":"string","title":"User Id"},"company_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Id"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["user_id","reason"],"title":"ImpersonateDataIn"},"ImpersonateEndIn":{"properties":{"token_id":{"type":"string","title":"Token Id"}},"type":"object","required":["token_id"],"title":"ImpersonateEndIn"},"ImpersonateReopenIn":{"properties":{"grant_id":{"type":"string","title":"Grant Id"},"app_slug":{"type":"string","title":"App Slug"}},"type":"object","required":["grant_id","app_slug"],"title":"ImpersonateReopenIn"},"ImpersonateUiEndIn":{"properties":{"grant_id":{"type":"string","title":"Grant Id"}},"type":"object","required":["grant_id"],"title":"ImpersonateUiEndIn"},"ImpersonateUiIn":{"properties":{"user_id":{"type":"string","title":"User Id"},"company_id":{"type":"string","title":"Company Id"},"app_slug":{"type":"string","title":"App Slug"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["user_id","company_id","app_slug","reason"],"title":"ImpersonateUiIn"},"InstalledAppResponse":{"properties":{"id":{"type":"string","title":"Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"api_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Base Url"},"ui_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ui Base Url"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"status":{"type":"string","title":"Status"},"is_platform":{"type":"boolean","title":"Is Platform","default":false},"config_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config Schema"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tagline"},"featured_rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Featured Rank"},"listing":{"additionalProperties":true,"type":"object","title":"Listing","default":{}},"company_app_id":{"type":"string","title":"Company App Id"},"company_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Id"},"installed_at":{"type":"string","format":"date-time","title":"Installed At"},"onboarded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Onboarded At"},"app_status":{"type":"string","title":"App Status"}},"type":"object","required":["id","slug","name","description","icon","api_base_url","ui_base_url","category","status","created_at","company_app_id","installed_at","app_status"],"title":"InstalledAppResponse"},"InstalledAppsResponse":{"properties":{"apps":{"items":{"$ref":"#/components/schemas/InstalledAppResponse"},"type":"array","title":"Apps"}},"type":"object","required":["apps"],"title":"InstalledAppsResponse"},"InvitationResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"invited_email":{"type":"string","title":"Invited Email"},"role":{"type":"string","title":"Role"},"app_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"},"invited_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invited By"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Accepted At"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"}},"type":"object","required":["id","company_id","invited_email","role","status","created_at"],"title":"InvitationResponse","description":"A invitations row; company_name present on cross-company lists."},"InvitationsListResponse":{"properties":{"invitations":{"items":{"$ref":"#/components/schemas/InvitationResponse"},"type":"array","title":"Invitations"}},"type":"object","required":["invitations"],"title":"InvitationsListResponse"},"InviteCreate":{"properties":{"proposed_grants":{"items":{"$ref":"#/components/schemas/ProposedGrant"},"type":"array","title":"Proposed Grants","default":[]},"resource_ref":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Resource Ref"},"ttl_hours":{"type":"integer","title":"Ttl Hours","default":72},"max_uses":{"type":"integer","title":"Max Uses","default":1}},"type":"object","title":"InviteCreate"},"InviteRequest":{"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"role":{"type":"string","title":"Role","default":"member"},"app_slug":{"type":"string","title":"App Slug","default":"onsuite"},"app_roles":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"App Roles"},"send_email":{"type":"boolean","title":"Send Email","default":true}},"type":"object","title":"InviteRequest"},"InviteResponse":{"properties":{"invitation":{"$ref":"#/components/schemas/CreatedInvitation"}},"type":"object","required":["invitation"],"title":"InviteResponse"},"InviteWithCredentialsRequest":{"properties":{"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role","default":"member"},"app_slug":{"type":"string","title":"App Slug","default":"onsuite"}},"type":"object","required":["email","name"],"title":"InviteWithCredentialsRequest"},"InviteWithCredentialsResponse":{"properties":{"member":{"$ref":"#/components/schemas/CredentialMember"},"temp_password":{"type":"string","title":"Temp Password"},"note":{"type":"string","title":"Note"}},"type":"object","required":["member","temp_password","note"],"title":"InviteWithCredentialsResponse"},"JobClaimIn":{"properties":{"app_slug":{"type":"string","title":"App Slug"},"worker":{"type":"string","title":"Worker","default":"worker"},"handlers":{"anyOf":[{"items":{"prefixItems":[{"anyOf":[{"type":"string"},{"type":"null"}]},{"type":"string"}],"type":"array","maxItems":2,"minItems":2},"type":"array"},{"type":"null"}],"title":"Handlers"}},"type":"object","required":["app_slug"],"title":"JobClaimIn"},"JobCreateIn":{"properties":{"app_slug":{"type":"string","maxLength":64,"minLength":1,"title":"App Slug"},"module":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Module"},"app_group":{"type":"string","maxLength":200,"title":"App Group","default":""},"kind":{"type":"string","maxLength":64,"minLength":1,"title":"Kind"},"criteria":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Criteria"},"label":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Label"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"ref":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Ref"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"checkpoint":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Checkpoint"}},"type":"object","required":["app_slug","kind"],"title":"JobCreateIn"},"JobEnqueueIn":{"properties":{"company_id":{"type":"string","title":"Company Id"},"app_slug":{"type":"string","title":"App Slug"},"module":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Module"},"app_group":{"type":"string","title":"App Group","default":""},"kind":{"type":"string","title":"Kind"},"criteria":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Criteria"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref"},"ref_policy":{"type":"string","enum":["reject","queue"],"title":"Ref Policy","default":"reject"},"order_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Order At"}},"type":"object","required":["company_id","app_slug","kind"],"title":"JobEnqueueIn"},"JobFinishIn":{"properties":{"outcome":{"type":"string","title":"Outcome"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"backoff_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Backoff Seconds"}},"type":"object","required":["outcome"],"title":"JobFinishIn"},"JobOut":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"app_slug":{"type":"string","title":"App Slug"},"module":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Module"},"app_group":{"type":"string","title":"App Group","default":""},"kind":{"type":"string","title":"Kind"},"criteria":{"additionalProperties":true,"type":"object","title":"Criteria","default":{}},"attempts":{"type":"integer","title":"Attempts","default":0},"max_attempts":{"type":"integer","title":"Max Attempts","default":5},"status":{"type":"string","title":"Status"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"done":{"type":"integer","title":"Done"},"progress":{"additionalProperties":true,"type":"object","title":"Progress"},"checkpoint":{"additionalProperties":true,"type":"object","title":"Checkpoint"},"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"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"},"heartbeat_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Heartbeat At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"},"ref_policy":{"type":"string","title":"Ref Policy","default":"reject"}},"type":"object","required":["id","company_id","app_slug","kind","status","total","done","progress","checkpoint","ref","parent_id","label","error","created_at","updated_at","heartbeat_at","finished_at"],"title":"JobOut"},"JobPatch":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"done":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Done"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"progress":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Progress"},"checkpoint":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Checkpoint"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"lease_owner":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Lease Owner"}},"type":"object","title":"JobPatch"},"JobPurgeIn":{"properties":{"app_slug":{"type":"string","title":"App Slug"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"},"ref_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref Prefix"}},"type":"object","required":["app_slug"],"title":"JobPurgeIn"},"JobSearchIn":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"app_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"},"company_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Id"},"module":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Module"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref"},"limit":{"type":"integer","title":"Limit","default":50}},"type":"object","title":"JobSearchIn"},"LinkIdentityRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"provider_id":{"type":"string","title":"Provider Id"}},"type":"object","required":["provider","provider_id"],"title":"LinkIdentityRequest"},"LogoutUrl":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"logout_url":{"type":"string","title":"Logout Url"}},"type":"object","required":["slug","name","logout_url"],"title":"LogoutUrl"},"LogoutUrlsResponse":{"properties":{"urls":{"items":{"$ref":"#/components/schemas/LogoutUrl"},"type":"array","title":"Urls"}},"type":"object","required":["urls"],"title":"LogoutUrlsResponse"},"LookupCompaniesResponse":{"properties":{"companies":{"items":{"$ref":"#/components/schemas/LookupCompany"},"type":"array","title":"Companies"}},"type":"object","required":["companies"],"title":"LookupCompaniesResponse"},"LookupCompany":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"type":{"type":"string","title":"Type"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","name","type","status"],"title":"LookupCompany"},"LookupUser":{"properties":{"id":{"type":"string","title":"Id"},"auth_id":{"type":"string","title":"Auth Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","auth_id","name","email","status"],"title":"LookupUser","description":"Display projection of users — same contract as on<app>.v_users."},"LookupUsersResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/LookupUser"},"type":"array","title":"Users"}},"type":"object","required":["users"],"title":"LookupUsersResponse"},"MagicLinkRequest":{"properties":{"email":{"type":"string","title":"Email"},"return_query":{"type":"string","title":"Return Query","default":""}},"type":"object","required":["email"],"title":"MagicLinkRequest"},"MemberAppRole":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"app_slug":{"type":"string","title":"App Slug"},"app_name":{"type":"string","title":"App Name"},"role_key":{"type":"string","title":"Role Key"},"role_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Label"}},"type":"object","required":["app_slug","app_name","role_key"],"title":"MemberAppRole"},"MemberEnvelope":{"properties":{"member":{"$ref":"#/components/schemas/MemberResponse"}},"type":"object","required":["member"],"title":"MemberEnvelope"},"MemberResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"app_roles":{"items":{"$ref":"#/components/schemas/MemberAppRole"},"type":"array","title":"App Roles","default":[]},"user":{"anyOf":[{"$ref":"#/components/schemas/MemberUser"},{"type":"null"}]}},"type":"object","required":["id","company_id","user_id","role","status","created_at"],"title":"MemberResponse","description":"A company_users row enriched with the user's display data and app roles."},"MemberUser":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"}},"type":"object","title":"MemberUser"},"MembersListResponse":{"properties":{"members":{"items":{"$ref":"#/components/schemas/MemberResponse"},"type":"array","title":"Members"},"invitations":{"items":{"$ref":"#/components/schemas/InvitationResponse"},"type":"array","title":"Invitations","default":[]}},"type":"object","required":["members"],"title":"MembersListResponse"},"ModuleToggleIn":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"ModuleToggleIn"},"OkResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","title":"OkResponse","description":"Generic acknowledgement for mutations with no meaningful payload."},"OnboardingStateResponse":{"properties":{"onboarded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Onboarded At"}},"type":"object","title":"OnboardingStateResponse"},"OverrideIn":{"properties":{"company_id":{"type":"string","title":"Company Id"},"app_slug":{"type":"string","title":"App Slug"},"entitlements":{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"null"}]},"type":"object","title":"Entitlements"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["company_id","app_slug","entitlements"],"title":"OverrideIn"},"PatResolveIn":{"properties":{"token":{"type":"string","title":"Token"},"app_slug":{"type":"string","title":"App Slug"},"company_id":{"type":"string","format":"uuid","title":"Company Id"}},"type":"object","required":["token","app_slug","company_id"],"title":"PatResolveIn"},"PatResolveOut":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"auth_id":{"type":"string","format":"uuid","title":"Auth Id"},"email":{"type":"string","title":"Email"},"company_id":{"type":"string","format":"uuid","title":"Company Id"},"app_slug":{"type":"string","title":"App Slug"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"},"is_superuser":{"type":"boolean","title":"Is Superuser"},"modules":{"items":{"type":"string"},"type":"array","title":"Modules","default":[]},"plan":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Plan"},"entitlements":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"null"}]},"type":"object"},{"type":"null"}],"title":"Entitlements"}},"type":"object","required":["user_id","auth_id","email","company_id","app_slug","permissions","is_superuser"],"title":"PatResolveOut"},"PathRequest":{"properties":{"path":{"type":"string","title":"Path"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In","default":3600}},"type":"object","required":["path"],"title":"PathRequest"},"PendingInvitationResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"company_name":{"type":"string","title":"Company Name"},"role":{"type":"string","title":"Role"},"app_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","company_id","company_name","role","created_at"],"title":"PendingInvitationResponse"},"PermissionsResponse":{"properties":{"company_id":{"type":"string","title":"Company Id"},"app_slug":{"type":"string","title":"App Slug"},"is_superuser":{"type":"boolean","title":"Is Superuser"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"},"modules":{"items":{"type":"string"},"type":"array","title":"Modules","default":[]},"plan":{"anyOf":[{"$ref":"#/components/schemas/PlanInfo"},{"type":"null"}]},"entitlements":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"null"}]},"type":"object"},{"type":"null"}],"title":"Entitlements"}},"type":"object","required":["company_id","app_slug","is_superuser","permissions"],"title":"PermissionsResponse","description":"Effective permissions for a user in a company for one app.\n\nSuperuser roles (app_roles.is_superuser, e.g. owner) resolve to every\naction defined for the app."},"PlanInfo":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"}},"type":"object","required":["slug","name"],"title":"PlanInfo","description":"The workspace's effective plan for one app (plan 030 rev)."},"PlatformFlagIn":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["enabled"],"title":"PlatformFlagIn"},"PreferencesUpdate":{"properties":{"sidebar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sidebar"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"density":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Density"},"apps":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Apps"}},"type":"object","title":"PreferencesUpdate"},"ProfileBlockCreate":{"properties":{"type":{"type":"string","title":"Type"},"app_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"},"payload":{"additionalProperties":true,"type":"object","title":"Payload","default":{}},"position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position"},"is_visible":{"type":"boolean","title":"Is Visible","default":true}},"type":"object","required":["type"],"title":"ProfileBlockCreate"},"ProfileBlockUpdate":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"},"position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position"},"is_visible":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Visible"}},"type":"object","title":"ProfileBlockUpdate","description":"Partial update."},"ProfileBlocksReorder":{"properties":{"order":{"items":{"type":"string"},"type":"array","title":"Order"}},"type":"object","required":["order"],"title":"ProfileBlocksReorder"},"ProfileUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"}},"type":"object","title":"ProfileUpdate"},"ProposedGrant":{"properties":{"capability":{"type":"string","maxLength":100,"minLength":1,"title":"Capability"},"kind":{"type":"string","title":"Kind"}},"type":"object","required":["capability","kind"],"title":"ProposedGrant"},"ProviderPlanIn":{"properties":{"app_slug":{"type":"string","title":"App Slug"},"plan_slug":{"type":"string","title":"Plan Slug"},"interval":{"type":"string","title":"Interval"},"provider_plan_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Plan Id"}},"type":"object","required":["app_slug","plan_slug","interval","provider_plan_id"],"title":"ProviderPlanIn"},"PublicAppListItem":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tagline"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"featured_rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Featured Rank"},"is_platform":{"type":"boolean","title":"Is Platform","default":false},"is_consumer":{"type":"boolean","title":"Is Consumer","default":false},"platforms":{"additionalProperties":true,"type":"object","title":"Platforms","default":{}},"get_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Get Url"}},"type":"object","required":["slug","name"],"title":"PublicAppListItem","description":"The COMPLETE set of fields GET /public/apps shows the anonymous internet. Like\nPublicProfileResponse, this model IS the allowlist: both routes use response_model=, so a column\nadded to {PS}.apps later cannot reach the wire unless it is added here deliberately."},"PublicAppModule":{"properties":{"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"default_enabled":{"type":"boolean","title":"Default Enabled","default":false}},"type":"object","title":"PublicAppModule"},"PublicAppPlan":{"properties":{"name":{"type":"string","title":"Name"},"price_amount":{"type":"integer","title":"Price Amount"},"price_currency":{"type":"string","title":"Price Currency"}},"type":"object","required":["name","price_amount","price_currency"],"title":"PublicAppPlan"},"PublicAppRef":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tagline"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"}},"type":"object","required":["slug","name"],"title":"PublicAppRef","description":"A `works_with` entry — LISTED apps only."},"PublicAppResponse":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tagline"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"featured_rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Featured Rank"},"is_platform":{"type":"boolean","title":"Is Platform","default":false},"is_consumer":{"type":"boolean","title":"Is Consumer","default":false},"platforms":{"additionalProperties":true,"type":"object","title":"Platforms","default":{}},"get_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Get Url"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"screenshots":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Screenshots","default":[]},"highlights":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Highlights","default":[]},"access":{"items":{"type":"string"},"type":"array","title":"Access","default":[]},"works_with":{"items":{"$ref":"#/components/schemas/PublicAppRef"},"type":"array","title":"Works With","default":[]},"modules":{"items":{"$ref":"#/components/schemas/PublicAppModule"},"type":"array","title":"Modules","default":[]},"plans":{"items":{"$ref":"#/components/schemas/PublicAppPlan"},"type":"array","title":"Plans","default":[]}},"type":"object","required":["slug","name"],"title":"PublicAppResponse","description":"GET /public/apps/{slug}: the list fields plus the detail page's content."},"ReasonIn":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","title":"ReasonIn"},"SSOLaunchRequest":{"properties":{"app_slug":{"type":"string","title":"App Slug"},"company_id":{"type":"string","title":"Company Id"},"purpose":{"type":"string","enum":["launch","identity"],"title":"Purpose","default":"launch"}},"type":"object","required":["app_slug","company_id"],"title":"SSOLaunchRequest"},"SSOLaunchResponse":{"properties":{"launch_url":{"type":"string","title":"Launch Url"}},"type":"object","required":["launch_url"],"title":"SSOLaunchResponse"},"ScheduleIn":{"properties":{"app_slug":{"type":"string","title":"App Slug"},"module":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Module"},"app_group":{"type":"string","title":"App Group","default":""},"kind":{"type":"string","title":"Kind"},"criteria":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Criteria"},"interval_seconds":{"type":"integer","minimum":60.0,"title":"Interval Seconds"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["app_slug","kind","interval_seconds"],"title":"ScheduleIn"},"ScheduleOut":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"app_slug":{"type":"string","title":"App Slug"},"module":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Module"},"app_group":{"type":"string","title":"App Group"},"kind":{"type":"string","title":"Kind"},"criteria":{"additionalProperties":true,"type":"object","title":"Criteria"},"ref":{"type":"string","title":"Ref"},"interval_seconds":{"type":"integer","title":"Interval Seconds"},"enabled":{"type":"boolean","title":"Enabled"},"next_run_at":{"type":"string","format":"date-time","title":"Next Run At"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run At"},"last_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Job Id"}},"type":"object","required":["id","company_id","app_slug","module","app_group","kind","criteria","ref","interval_seconds","enabled","next_run_at","last_run_at","last_job_id"],"title":"ScheduleOut"},"ScheduleSearchIn":{"properties":{"app_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"},"company_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Id"}},"type":"object","title":"ScheduleSearchIn"},"ScheduleUpsertIn":{"properties":{"company_id":{"type":"string","title":"Company Id"},"app_slug":{"type":"string","title":"App Slug"},"module":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Module"},"app_group":{"type":"string","title":"App Group","default":""},"kind":{"type":"string","title":"Kind"},"criteria":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Criteria"},"interval_seconds":{"anyOf":[{"type":"integer","minimum":60.0},{"type":"null"}],"title":"Interval Seconds"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["company_id","app_slug","kind"],"title":"ScheduleUpsertIn"},"SendOTPRequest":{"properties":{"phone":{"type":"string","title":"Phone"}},"type":"object","required":["phone"],"title":"SendOTPRequest"},"ServiceCheckoutIn":{"properties":{"app_slug":{"type":"string","title":"App Slug"},"company_id":{"type":"string","title":"Company Id"},"plan_slug":{"type":"string","title":"Plan Slug"},"interval":{"type":"string","title":"Interval","default":"month"},"mode":{"type":"string","title":"Mode","default":"order"}},"type":"object","required":["app_slug","company_id","plan_slug"],"title":"ServiceCheckoutIn"},"SignupRequest":{"properties":{"name":{"type":"string","title":"Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"onboarding_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Onboarding Data"},"mark_platform_onboarded":{"type":"boolean","title":"Mark Platform Onboarded","default":false}},"type":"object","required":["name"],"title":"SignupRequest"},"SignupResponse":{"properties":{"user":{"$ref":"#/components/schemas/UserResponse"},"company":{"anyOf":[{"$ref":"#/components/schemas/CompanyResponse"},{"type":"null"}]}},"type":"object","required":["user"],"title":"SignupResponse"},"StoreNotifyIn":{"properties":{"store":{"type":"string","maxLength":32,"minLength":3,"title":"Store"},"company_id":{"type":"string","maxLength":64,"minLength":8,"title":"Company Id"},"kind":{"type":"string","enum":["store_ready","store_stuck"],"title":"Kind"}},"type":"object","required":["store","company_id","kind"],"title":"StoreNotifyIn"},"SweepOut":{"properties":{"reaped":{"type":"integer","title":"Reaped"},"scheduled":{"type":"integer","title":"Scheduled"}},"type":"object","required":["reaped","scheduled"],"title":"SweepOut"},"TeamMemberResponse":{"properties":{"id":{"type":"string","title":"Id"},"company_id":{"type":"string","title":"Company Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"app_roles":{"items":{"$ref":"#/components/schemas/MemberAppRole"},"type":"array","title":"App Roles","default":[]},"user":{"anyOf":[{"$ref":"#/components/schemas/MemberUser"},{"type":"null"}]},"company_name":{"type":"string","title":"Company Name"},"can_manage":{"type":"boolean","title":"Can Manage"},"viewer_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Viewer Role"}},"type":"object","required":["id","company_id","user_id","role","status","created_at","company_name","can_manage"],"title":"TeamMemberResponse","description":"Cross-company member as returned by GET /api/team."},"TeamResponse":{"properties":{"members":{"items":{"$ref":"#/components/schemas/TeamMemberResponse"},"type":"array","title":"Members"}},"type":"object","required":["members"],"title":"TeamResponse"},"TokenCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"workspaces":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Workspaces"},"apps":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Apps"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes","default":["write"]},"expires_in_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In Days","default":90}},"type":"object","required":["name"],"title":"TokenCreate"},"TokenCreated":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"token_prefix":{"type":"string","title":"Token Prefix"},"allowed_companies":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Allowed Companies"},"allowed_apps":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Apps"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"token":{"type":"string","title":"Token"}},"type":"object","required":["id","name","token_prefix","allowed_companies","allowed_apps","scopes","created_at","last_used_at","expires_at","revoked_at","token"],"title":"TokenCreated"},"TokenOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"token_prefix":{"type":"string","title":"Token Prefix"},"allowed_companies":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Allowed Companies"},"allowed_apps":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Apps"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","name","token_prefix","allowed_companies","allowed_apps","scopes","created_at","last_used_at","expires_at","revoked_at"],"title":"TokenOut"},"UpdateMemberRequest":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"UpdateMemberRequest"},"UserEnvelope":{"properties":{"user":{"$ref":"#/components/schemas/UserResponse"}},"type":"object","required":["user"],"title":"UserEnvelope"},"UserResponse":{"properties":{"id":{"type":"string","title":"Id"},"auth_id":{"type":"string","title":"Auth Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"status":{"type":"string","title":"Status"},"handle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handle"},"onboarding_data":{"additionalProperties":true,"type":"object","title":"Onboarding Data","default":{}},"preferences":{"additionalProperties":true,"type":"object","title":"Preferences","default":{}},"force_password_change":{"type":"boolean","title":"Force Password Change","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","auth_id","name","email","status","created_at","updated_at"],"title":"UserResponse"},"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"},"VerifyOTPRequest":{"properties":{"phone":{"type":"string","title":"Phone"},"otp":{"type":"string","title":"Otp"}},"type":"object","required":["phone","otp"],"title":"VerifyOTPRequest"},"WaitlistAccepted":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true}},"type":"object","title":"WaitlistAccepted"},"WaitlistIn":{"properties":{"app_slug":{"type":"string","maxLength":32,"minLength":4,"title":"App Slug"},"email":{"type":"string","maxLength":254,"minLength":3,"title":"Email"},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Name"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"},"source":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Source"},"env":{"type":"string","enum":["production","preview","development"],"title":"Env","default":"production"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"website":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Website"}},"type":"object","required":["app_slug","email"],"title":"WaitlistIn"},"WhatsAppOtpSendResponse":{"properties":{"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["expires_in"],"title":"WhatsAppOtpSendResponse"},"WhatsAppOtpStatusResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"WhatsAppOtpStatusResponse"},"WhatsAppOtpVerifyResponse":{"properties":{"linked":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Linked"},"token_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Hash"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"is_new_user":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is New User"}},"type":"object","title":"WhatsAppOtpVerifyResponse","description":"Two shapes: {linked} when an authed user links a phone; {token_hash, type,\nis_new_user} on login/register (client passes token_hash to supabase verifyOtp)."}}}}