Switch the active workspace
Re-scopes the session to another workspace the caller can reach (workspace
switcher P2). Verifies the caller’s verified email has a policy-passing
membership in the target - the identical signin_decision gate as sign-in,
so this never grants access a fresh sign-in wouldn’t - then re-mints the
vault-sealed session cookie for the target identity (Pattern 2: instant, no
Slack re-auth). Returns 200 + a fresh Set-Cookie; the SPA reloads into the
new workspace. 403 if the caller has no eligible membership in the target.
Authorizations
Browser session cookie set by sign-in. Web SPA only; not for PAT/OAuth integrators.
Body
Tenant slug of the workspace to switch to.
Response
Active workspace switched (fresh session cookie set)
Whether the target tenant has finished onboarding. The SPA lands the
user on /onboarding when false (the router gate is the backstop).
Native clients (the iOS/mobile app, X-Hq-Native: 1) can't ride the
Set-Cookie re-scope - they store an explicit bearer. When the switch is
requested natively we additionally mint a fresh native session token
(hqses_<sealed>) for the target workspace, byte-identical underneath to
the cookie. None for web callers (they use the cookie).