GhaylStackDocumentationv1.0.2
العربيةWebsite
Platform modules

Platform modules

Tenants and workspace provisioning

Create an isolated workspace, track provisioning and manage its status and visual identity.

Tenant or organizational unit?

A tenant represents an independently managed workspace. Departments and branches belong to the Organizations module inside that tenant. Create another tenant when the application needs another workspace boundary; create an organizational unit when the same institution needs an internal hierarchy.

The Multitenancy module exposes /api/v1/tenants. Its administration permissions, including Permissions.Tenants.Create and Permissions.Tenants.Update, are registered as root permissions. Theme viewing and editing are separately available within tenant contexts.

Create and provision a workspace

Tenant creation takes an ID, name, administrator email and initial password, with optional connection string, issuer and plan key. Use the Admin application for an initial walkthrough; consult CreateTenantCommand when implementing an API client.

The creation handler first resolves the selected billing plan and its term. It creates the tenant with a validity window, buffers the initial administrator password for the background initialization step, starts provisioning and publishes a subscription integration event through the outbox.

The response contains the tenant ID, a provisioning correlation ID and status. Creation being accepted is not proof that the workspace is ready. Query GET /api/v1/tenants/{tenantId}/provisioning and inspect the initialization result before sending users to sign in. The retry route is POST /api/v1/tenants/{tenantId}/provisioning/retry.

Operate the tenant lifecycle

Operation Route beneath /api/v1/tenants Permission
View status GET /{id}/status Permissions.Tenants.View
Change activation POST /{id}/activation Permissions.Tenants.Update
Renew the term POST /{id}/renew Permissions.Tenants.UpgradeSubscription
Adjust validity POST /{id}/adjust-validity Permissions.Tenants.UpgradeSubscription
Read the current theme GET /theme Permissions.Tenants.ViewTheme
Save or reset the theme PUT /theme, POST /theme/reset Permissions.Tenants.UpdateTheme

Activation and subscription validity are separate controls. A scheduled tenant-expiry-scan runs at 02:00 UTC to evaluate approaching expiry, grace and expired states. Billing consumers handle the related subscription events; see Billing for invoices and wallets.

Apply a tenant identity

Open the tenant appearance settings and save the logo, icon and light or dark theme values supported by TenantThemeDto. The theme service stores the tenant's settings and invalidates its cache after updates. Use the reset route to return to the default theme instead of manually deleting stored branding records.

Verify the result in Dashboard, then open a different tenant in another browser profile. The second workspace should retain its own appearance. Reports obtain the current tenant's eligible uploaded logo through the same theme service; an arbitrary remote image URL is not fetched as report branding.

Verify and troubleshoot

If creation fails before provisioning begins, check the plan key and required administrator fields. If provisioning remains incomplete, use its correlation ID to inspect migrator and seed logs. Confirm that an optional dedicated connection string is reachable from the server.

If users cannot enter an existing workspace, inspect activation, validity and their account status rather than recreating the tenant. If the wrong logo appears, confirm the active tenant and theme response, then inspect client state. See Configuration and Migrations before changing database settings on existing data.

Implementation references

View MarkdownBack to top

Search documentation

Use ↑ ↓ to move, Enter to open and Esc to close.