Set the active organization for this session.
POST
/_torii/organizations/{organizationId}/switch
const url = 'https://your-app.torii.so/_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.torii.so/_torii/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/switchRe-mints the access token with an org_id 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 type application/json
object
accessToken
required
string
expiresAt
required
string format: date-time
Example generated
{ "accessToken": "example", "expiresAt": "2026-04-15T12:00:00Z"}