Set the active organization for this session.
POST
/_torii/organizations/{organizationId}/switch
const url = 'https://your-app.toriiauth.eu/_torii/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/switch';const options = {method: 'POST'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-app.toriiauth.eu/_torii/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/switchRe-mints the access token with the active organization in the o claim. Caller must be a member of the target org.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”organizationId
required
string format: uuid
Responses
Section titled “Responses”OK
Media typeapplication/json
object
accessToken
required
string
expiresAt
required
string format: date-time
Examplegenerated
{ "accessToken": "example", "expiresAt": "2026-04-15T12:00:00Z"}