POST /api/v1/me/switch-organization
Requires BearerAuth.
Switches the active organization for the session. Because the access token is organization-scoped, switching requires re-issuing both tokens. The provided refresh token is rotated — the old one is invalidated and a new session is returned scoped to the target organization.
The caller must already be a member of the target organization. Use the
organizations array from login or GET /api/v1/me to find valid organization IDs.Request body
UUID of the organization to switch to.
The current refresh token. It is rotated as part of this operation.
Response
Returns a fullSessionResponse scoped to the new organization, identical in structure to login.
New JWT access token scoped to the target organization. Expires after 1 hour.
New JWT refresh token. Expires after 30 days. The previous token is now invalid.
The authenticated user.
The newly active organization.
All organizations the caller is a member of.
Errors
| Status | When |
|---|---|
400 | Request body is missing or malformed |
401 | The access token or refresh token is missing or invalid |
403 | The caller is not a member of the target organization |