X Enterprises
Composables

useXAdminTenants

Provides admin actions for tenant lifecycle management including suspension, activation, plan changes, and settings updates.

useXAdminTenants

Tenant management composable. Wraps /api/admin/tenants/* endpoints with typed async actions for suspending or activating tenants, changing billing plans, and updating per-tenant settings and feature flags. Pairs with XAdminTenantsDirectory, XAdminTenantsDetail, XAdminTenantsSettings, and XAdminTenantsBilling.

Usage

const tenants = useXAdminTenants()

await tenants.suspend(tenantId, "Violation reason")
await tenants.activate(tenantId)
await tenants.updatePlan(tenantId, "enterprise")
await tenants.updateSettings(tenantId, { maxUsers: 100 })

Returns

KeyTypeDescription
suspend(tenantId: string, reason?: string) => Promise<void>Suspends a tenant account with an optional reason.
activate(tenantId: string) => Promise<void>Reactivates a suspended tenant.
updatePlan(tenantId: string, plan: string) => Promise<void>Changes the billing plan for a tenant.
updateSettings(tenantId: string, settings: Record<string, unknown>) => Promise<void>Updates tenant-level settings such as user limits and feature flags.

AI Context

composable: useXAdminTenants
package: "@xenterprises/nuxt-x-app-admin"
use-when: >
  Managing multi-tenant accounts from the admin portal — suspending or activating
  tenants, upgrading or downgrading billing plans, or configuring per-tenant
  settings and feature flags.
pairs-with: XAdminTenantsDirectory, XAdminTenantsDetail, XAdminTenantsSettings, XAdminTenantsBilling
Copyright © 2026