Skip to content

Switch Organization

POST /auth/organizations/switch

Sign in to another of your organizations without signing in again.

The pair it returns is anchored at your membership of that organization, with that membership’s role, which is not necessarily the one you have here. The refresh cookie is replaced the way a sign-in replaces it.

404 when you hold no active seat in that organization. That is also the answer when the organization does not exist, and when the account at your address inside it belongs to somebody else: telling those apart would answer questions about other people’s accounts.

Request body — SwitchOrganizationRequest

Section titled “Request body — SwitchOrganizationRequest”
FieldTypeNotes
organization_idstring (uuid)required—
StatusDescriptionBody
200Successful ResponseTokenPair
422Validation ErrorHTTPValidationError

The body shows the fields the schema always carries. Which combination is legal is a service rule the schema cannot express, so read the description above before copying this.

Terminal window
curl -X POST https://your-deployment.example.com/auth/organizations/switch \
-H "Authorization: Bearer $COBRE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"organization_id": "0190a2f4-0000-7000-8000-000000000000"
}'
FieldTypeNotes
access_tokenstringrequired—
refresh_tokenstringrequired—
token_typestringoptionalDefault "bearer".
expires_inintegerrequired—
principalPrincipalViewrequired—