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

# Multi-Organization

> Multi-Organization feature allows users to belong to multiple organizations using the same email address

## What is Multi-Organization?

Multi-Organization is a feature that allows users to belong to multiple organizations using the same email address. This enables seamless switching between organizations without requiring separate login credentials.

**Key Benefits:**

* Single email address across multiple organizations
* Seamless switching between organizations from your profile
* Create new organizations without logging out
* Password synchronization across all organizations

## How It Works

1. **Login** - User logs in normally with their email and password
2. **Auto-Selection** - System automatically logs user into their most recently accessed organization
3. **View Organizations** - User can view all their organizations from the profile menu
4. **Switch** - User can switch to any organization they belong to
5. **Create New** - User can create additional organizations (if permitted)

<Note>
  When you switch organizations, your current session token is revoked and a new token is issued for the target organization. Make sure to update your stored token after switching.
</Note>

## API Endpoints

<CardGroup cols={2}>
  <Card title="Get User Organizations" icon="list" href="/api-reference/auth/multi-organization/get-user-organizations">
    GET /auth/my-organizations
  </Card>

  <Card title="Switch Organization" icon="arrow-right-arrow-left" href="/api-reference/auth/multi-organization/switch-organization">
    POST /auth/switch-organization
  </Card>

  <Card title="Create Organization" icon="plus" href="/api-reference/auth/multi-organization/create-organization">
    POST /auth/create-organization
  </Card>
</CardGroup>

## Copy Data Feature

When creating a new organization, you can optionally copy data from your first organization where you have the **owner** role (either as the original creator or as an invited owner).

### What Gets Copied

| Data                      | Copied | Notes                                   |
| ------------------------- | ------ | --------------------------------------- |
| Organization Settings     | ✅      | Language, currency, configuration       |
| Hubs                      | ✅      | All hubs you have access to             |
| Custom Roles              | ✅      | Only with system permissions            |
| Flows                     | ✅      | All custom and default flows            |
| Default Roles             | ❌      | Always created from standard templates  |
| Custom Module Permissions | ❌      | Organization-specific, not transferable |

### Important Notes

* **Default roles** (Owner, Admin, Planner, Field User) are always created from standard templates with their default permissions
* **Custom roles** are copied but only retain **system permissions** - any custom module permissions are excluded
* **Invited owners** can also use the copy feature - you don't need to be the original organization creator

## Password Behavior

When a user belongs to multiple organizations:

* **Password Sync**: Password changes are synchronized across all organizations automatically
* **Password Reset**: Admin can only reset passwords for users who originally registered in their organization (not for invited users)

<Warning>
  **Password Reset Restriction**: If a user was invited to your organization from another organization, you cannot reset their password. Only the organization where the user originally registered can perform password resets.
</Warning>

## Permissions

| Permission            | Description                          |
| --------------------- | ------------------------------------ |
| `create/organization` | Required to create new organizations |

## Related Guides

* [User Management](/pages/setting/user-management/introduction-to-user-management)
* [Role and Permission Management](/pages/setting/role-and-permission-management/introduction-to-role-and-permission)
