Organization Management

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

The Organization Management section at /admin/organizations provides oversight of all teams on your platform.

Organization List

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

Admin Organizations TableClick to expand

Table Columns

Each organization row displays:

ColumnDescription
LogoOrganization avatar or default icon
NameOrganization display name
SlugURL-friendly identifier
MembersTotal member count
CreatedOrganization creation date
FunctionsView details button

Organization Details

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

Organization Details SheetClick to expand

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, trialing, 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
// Fetching subscription data for an organization
import { createServerFn } from '@tanstack/react-start';
import { adminFunctionMiddleware } from '@kit/function-middleware/functions';
import { withAdminPermission } from '@kit/function-middleware/server';
export const getSubscriptionsByReferenceIdFunction = createServerFn({ method: 'POST' }).middleware([...adminFunctionMiddleware, withAdminPermission({
subscriptions: ['list'],
})
.validator(getSubscriptionsByReferenceIdSchema)
.handler(async ({ data }) => {
const { referenceId, customerType } = data;
const billing = await getBilling(auth);
const result = await billing.listSubscriptions({
referenceId,
customerType,
});
return {
subscriptions: result.subscriptions,
};
});

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 panel. This allows quick access to user management functions without leaving the organization view.

// Fetching organization members
import { createServerFn } from '@tanstack/react-start';
import { adminFunctionMiddleware } from '@kit/function-middleware/functions';
import { withAdminPermission } from '@kit/function-middleware/server';
export const getOrganizationMembersFunction = createServerFn({ method: 'POST' }).middleware([...adminFunctionMiddleware, withAdminPermission({
organizations: ['view'],
})
.validator(getOrganizationMembersSchema)
.handler(async ({ data }) => {
const { organizationId } = data;
const service = createAdminDashboardService();
return await service.getOrganizationMembers(organizationId);
});

Permission Requirements

Organization management requires these RBAC permissions:

FunctionRequired Permission
List organizationsorganizations:list
View organization detailsorganizations:view
View organization subscriptionssubscriptions:list
View/manage membersuser:get (for member details)

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

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:

// packages/admin/src/organizations/lib/loaders/organizations-page.loader.ts
import { requireAdmin } from '@kit/auth/require-admin';
import { listOrganizationsSchema } from '../schemas';
import { createOrganizationsAdminService } from '../services/organizations-admin.service';
export const loadOrganizationsPageData = async (params = {}) => {
const admin = await requireAdmin(); // Ensures admin access
const parsed = listOrganizationsSchema.parse({
searchValue: params.search,
limit: 25,
offset: ((params.page ?? 1) - 1) * 25,
sortBy: params.sortBy,
sortDirection: params.sortDirection,
});
const service = createOrganizationsAdminService();
const result = await service.listOrganizations(parsed);
return { ...result, currentUserId: admin.id };
};

This loader runs inside the admin route's loader (under the requireAdminAuth beforeLoad guard) — there is no import 'server-only' or React cache() in TanStack Start; per-request reads live in route loaders and server functions.

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

// Fetched via TanStack Query when the details panel opens
const { data: members = [], isLoading } = useQuery({
queryKey: ['admin', 'organization-members', organizationId],
queryFn: () =>
getOrganizationMembersFunction({ data: { organizationId } }).then(
(result) => result.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.

This design separates concerns:

  • Admin Panel: Platform-wide oversight and user management
  • Team Interface: Day-to-day organization management by team owners

If you need admin functions for organizations (e.g., force delete, transfer ownership), see Extending Admin for adding custom functionality.

Common Workflows

Finding a User's Organizations

  1. Go to /admin/users
  2. Find and click on the user
  3. In the user details panel, view their organization memberships
  4. Click on any organization to see full details

Checking Subscription Status

  1. Go to /admin/organizations
  2. Search for the organization
  3. Click "View Details"
  4. Subscription information appears in the details panel

Investigating Member Issues

  1. Find the organization at /admin/organizations
  2. Click "View Details"
  3. Browse the member list
  4. Click on any member to access their user details and functions

Previous: User Management

Next: RBAC Permissions