General
Admin Panel
Organizations
View and manage all organizations in your application from the admin panel.
The Organizations section of the admin panel provides a comprehensive view of all organizations in your system, allowing you to monitor, filter, and manage organization data.
Features
View All Organizations
The organizations table displays all organizations with key information:
- Organization Name - The name of the organization
- Slug - The URL-friendly identifier
- Member Count - Number of members in the organization
- Created Date - When the organization was created
- Owner - The user who created the organization
Filter Organizations
Filter organizations by various criteria:
- Search Query - Search by organization name or slug
- Member Count - Filter by number of members
- Creation Date - Filter by when the organization was created
- Owner - Filter by organization owner
Bulk Actions
Perform actions on multiple organizations simultaneously:
- Delete Organizations - Remove multiple organizations at once
- Bulk Updates - Update settings for multiple organizations
Using the Admin Organizations API
List Organizations
app/admin/organizations/page.tsx
import { trpc } from '@/trpc/client';
export function OrganizationsTable() {
const { data, isPending } = trpc.admin.organization.list.useQuery({
limit: 25,
offset: 0,
query: '', // Optional search query
sortBy: 'name', // 'name' | 'membersCount' | 'createdAt'
sortOrder: 'asc', // 'asc' | 'desc'
filters: {
membersCount: ['1-5'], // Optional: '0' | '1-5' | '6-10' | '11+'
createdAt: ['today'] // Optional: 'today' | 'this-week' | 'this-month' | 'older'
}
});
return (
<div>
{data?.organizations.map((org) => (
<div key={org.id}>
{org.name} - {org.membersCount} members
</div>
))}
</div>
);
}View Organization Details
The admin panel provides organization details through the list query results. Each organization includes:
- Members and their roles - Available in the organization data
- Organization settings - Name, slug, and other metadata
- Subscription information - Linked subscription data
- Billing information - Stripe customer ID and related data
Organization Management
Monitoring Organizations
Use the admin panel to:
- Track Growth - Monitor organization creation trends
- Identify Large Organizations - Find organizations with many members
- Detect Issues - Identify organizations that may need attention
- Audit Activity - Review organization-related activities
Best Practices
Organization Monitoring
- Regularly review organization growth - Monitor member counts for capacity planning - Track organization creation patterns - Identify inactive organizations
Bulk Operations
- Use bulk actions carefully - Always confirm before deleting organizations
- Consider data retention policies - Backup data before bulk deletions
Organization Data
- Respect organization privacy - Only access organization data when necessary - Follow data protection regulations - Document any manual interventions
Related Documentation
- Organizations Overview - Learn about organizations
- Use Organizations - Understand how organizations work