> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Exchange organization sessions

> Seamlessly switch a member's session between organizations.

## 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:

<Columns cols={2}>
  <Card title="session.exchange()" icon="code" href="/api-reference/b2b/frontend-sdks/react/methods/sessions/exchange-session">
    Exchange the member's current session for a session in a specified organization.
  </Card>
</Columns>

***

## Build an organization switcher

<Tip>See our [example apps](https://github.com/stytchauth/stytch-all-examples/) for a code example of an organization switcher component.</Tip>

<Steps>
  <Step title="List organizations the user has access to">
    Use the `discovery.organizations.list()` [method](/api-reference/b2b/frontend-sdks/react/methods/discovery/list-discovered-organizations) to retrieve a list of organizations the user has access to:

    ```jsx theme={null}
    export const listOrganizations = async () => {
        const { discovered_organizations } = await stytch.discovery.organizations.list();
        return discovered_organizations;
    };
    ```
  </Step>

  <Step title="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](/api-reference/b2b/frontend-sdks/react/methods/sessions/exchange-session):

    ```jsx theme={null}
    export const exchange = (target_organization_id) => {
        stytch.session.exchange({
            organization_id: target_organization_id,
            session_duration_minutes: DESIRED_SESSION_LENGTH,
        });
    };
    ```
  </Step>

  <Step title="Notes" icon="info">
    * If additional authentication is required for the selected organization, the Exchange session method returns an `intermediate_session_token` instead of a fully minted session.
  </Step>
</Steps>
