Set active organization for current session
Switches the active organisation on the authenticated session. Called in-process via auth.api.setActiveOrganization so server-to-server requests are not subject to Better Auth’s Origin-header CSRF check. Better Auth rotates the active-org cookie; the rotated Set-Cookie headers are forwarded on the response so the browser’s cookie jar is updated atomically with the 201 reply.
Body
Id of the organization to set as the active organisation on the authenticated session.
1 - 256Response
Successfully switched active organization
The organisation that was set as the active organisation on the authenticated session.
A Better Auth organisation the authenticated user belongs to, normalised to the public Avido shape (Prisma-nullable slug/domain surfaced as absent rather than null).