Switch Organization
POST /auth/organizations/switchSign 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”| Field | Type | Notes | |
|---|---|---|---|
organization_id | string (uuid) | required | — |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | Successful Response | TokenPair |
422 | Validation Error | HTTPValidationError |
Example
Section titled “Example”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.
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" }'Response — TokenPair
Section titled “Response — TokenPair”| Field | Type | Notes | |
|---|---|---|---|
access_token | string | required | — |
refresh_token | string | required | — |
token_type | string | optional | Default "bearer". |
expires_in | integer | required | — |
principal | PrincipalView | required | — |