Switch Tenant
Switch to a different tenant without re-authenticating. Requires a valid JWT. Validates the user has an active ``tenant_users`` entry in the target tenant, issues a new JWT scoped to that tenant, creates a new session record, and blacklists the old session.
Switch to a different tenant without re-authenticating.
Requires a valid JWT. Validates the user has an active tenant_users
entry in the target tenant, issues a new JWT scoped to that tenant,
creates a new session record, and blacklists the old session.
AuthorizationBearer <token>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/auth/switch-tenant" \ -H "Content-Type: application/json" \ -d '{ "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0" }'{
"access_token": "string",
"expires_in": 0,
"requires_tenant_selection": false,
"tenants": [
{
"tenant_id": "string",
"tenant_name": "string"
}
],
"token_type": "Bearer",
"user": {
"email": "string",
"email_verified": true,
"full_name": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"is_azure_bound": true,
"role": "super_admin",
"tenant_activated_at": "2019-08-24T14:15:22Z"
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}