Overview
Session tokens are valid for one organization at a time, but you can exchange a member’s active session for a session with another organization using the Session exchange endpoint:session.exchange()
Exchange the member’s current session for a session in a specified organization.
Build an organization switcher
1
List organizations the user has access to
Use the
discovery.organizations.list() method to retrieve a list of organizations the user has access to:2
Exchange the active session
Once the user selects an organization, exchange their active session for a session in the selected organization using the
session.exchange() method:Notes
- If additional authentication is required for the selected organization, the Exchange session method returns an
intermediate_session_tokeninstead of a fully minted session.