# Organization Management

> Oversee organizations, view members, and manage team subscriptions from the admin panel.

*Canonical: https://makerkit.dev/docs/nextjs-prisma/admin/organization-management*

---

Organization Management gives admins read-only oversight of all teams on your platform. Search organizations, view member lists, check subscription status, and click through to individual user management. The admin panel currently provides viewing capabilities; modifying organizations (settings, members, deletion) is done through the standard team interface.

> Organization billing depends on your account mode: Team Mode attaches billing to organizations, Personal Mode to individual users.

## Organization List

### Search

Use the search input to find organizations by name. Results update as you type and are paginated.

{% img src="/images/docs/admin-organizations-table.webp" width="2844" height="1938" alt="Admin Organizations Table" /%}

### Table Columns

Each organization row displays:

| Column | Description |
|--------|-------------|
| **Logo** | Organization avatar or default icon |
| **Name** | Organization display name |
| **Slug** | URL-friendly identifier |
| **Members** | Total member count |
| **Created** | Organization creation date |
| **Actions** | View details button |

## Organization Details

Click "View Details" to open a side panel with comprehensive organization information.

{% img src="/images/docs/admin-organization-detail.webp" width="2844" height="1938" alt="Organization Details Sheet" /%}

### Overview Section

- **Logo and Name**: Organization branding
- **Slug**: URL identifier for the organization
- **Member Count**: Total team members
- **Created Date**: When the organization was created

### Subscription Information

When billing is enabled and the admin has `subscriptions:list` permission, the panel shows:

- **Plan Name**: Current subscription tier
- **Status**: Active, canceled, past due, etc.
- **Billing Period**: Monthly or yearly
- **Next Billing Date**: Upcoming renewal

Organizations inherit billing based on your account mode configuration:

- **Team Mode**: Billing attached to organizations
- **Personal Mode**: Billing attached to individual users

### Member List

All organization members are displayed with:

- **Avatar**: Member's profile picture
- **Name**: Display name
- **Email**: Member's email address
- **Role**: Organization role (owner, admin, member)
- **Status**: Active or banned indicator

Click any member to open their [User Details](./user-management#view-details) panel. This allows quick access to user management actions without leaving the organization view.

## Permission Requirements

Organization management requires these RBAC permissions:

| Action | Required Permission |
|--------|-------------------|
| List organizations | `organizations:list` |
| View organization details | `organizations:view` |
| View organization subscriptions | `subscriptions:list` |
| View/manage members | `user:get` (for member details) |

The default `admin` role has all permissions. For custom roles:

```typescript
export default defineAdminRBACConfig({
  roles: {
    support: 50,
  },
  permissions: {
    support: {
      organizations: ['list', 'view'],
      subscriptions: ['list'],
      user: ['list', 'get'],
    },
  },
});
```

## Data Loading

Organization data is loaded server-side with admin protection:

```typescript
// packages/admin/src/organizations/lib/loaders/organizations-page.loader.ts
import 'server-only';
import { cache } from 'react';
import { requireAdmin } from '@kit/auth/require-admin';

export const loadOrganizationsPageData = cache(async (params) => {
  await requireAdmin();  // Ensures admin access

  const service = createOrganizationsAdminService();
  return service.listOrganizations({
    searchValue: params.search,
    limit: 25,
    offset: (params.page - 1) * 25,
    sortBy: params.sortBy,
    sortDirection: params.sortDirection,
  });
});
```

Member data is fetched on-demand when viewing organization details:

```typescript
// Fetched via React Query when details panel opens
const { data: members = [], isLoading } = useQuery({
  queryKey: ['admin', 'organization-members', organizationId],
  queryFn: () =>
    getOrganizationMembersAction({ organizationId }).then(
      (result) => result.data?.members || []
    ),
});
```

## Read-Only Access

The current admin panel provides read-only access to organizations. For modifying organizations (updating settings, managing members, deleting), users should access the organization directly through the standard team interface.

If you need admin actions for organizations, see [Extending Admin](./extending-admin) for adding custom functionality.

{% faq
   title="Frequently Asked Questions"
   items=[
     {"question": "Can I delete an organization from the admin panel?", "answer": "Not currently. The admin panel provides read-only access to organizations. To delete an organization, access it through the standard team interface as the organization owner."},
     {"question": "How do I see an organization's subscription details?", "answer": "Click 'View Details' on any organization row. The side panel shows subscription info if billing is enabled and you have the subscriptions:list permission."},
     {"question": "Can I add or remove organization members as an admin?", "answer": "Not directly. Click on a member to access their user details, where you can ban or manage their account. Member management is done through the organization's team settings."},
     {"question": "Why don't I see subscription information?", "answer": "Ensure billing is enabled in your app configuration and your admin role has the subscriptions:list permission in the RBAC config."}
   ]
/%}

---

**Previous:** [User Management](./user-management)

**Next:** [RBAC Permissions](./rbac-permissions)
