Skip to content

Tenant Management

Platform admins create and manage lab tenants from Admin Portal → Tenants. Each tenant represents one diagnostic laboratory with its own database, users, and subscription.

Tenant list columns

ColumnDescription
Name / SlugDisplay name and URL slug (/portal/{slug})
StatusPendingSetup, Active, Suspended, Inactive
PaymentTrial, Current, Unpaid, Overdue
LockedRead-only indicator
ProvisioningPending, InProgress, Completed, Failed
PlanActive subscription package name
CreatedRegistration date

Create / edit tenant form

FieldRequiredDescription
NameYesLab display name
SlugYesURL-safe identifier; used in portal URL and database name
Logo URLNoBranding for public portal
Portal URLNoOverride default portal link
Contact emailNoPrimary lab contact
Contact phoneNoPrimary lab phone
StatusYesOperational status
Payment statusYesBilling state
Trial ends atNoUTC datetime; auto-locks when expired
NotesNoInternal operator notes

API: POST /admin/tenants (create), PUT /admin/tenants/{id} (update).

Provisioning

New tenants need a dedicated PostgreSQL database:

ActionEndpointResult
ProvisionPOST /admin/tenants/{id}/provisionCreates easelab_tenant_{slug}, runs migrations, seeds defaults

Monitor provisioningStatus:

ValueMeaning
PendingNot started
InProgressRunning
CompletedReady for use
FailedCheck provisioningError

Lock and unlock

Lock (read-only mode)

POST /admin/tenants/{id}/lock with { "reason": "..." }

EffectDetail
isLockedSet to true
MutationsBlocked for tenant users (HTTP 403, TENANT_READONLY)
ReadsStill allowed
Billing routesExempt — tenant can still subscribe

Unlock

POST /admin/tenants/{id}/unlock — clears lock and restores write access.

Automatic locks also occur when trials expire or subscriptions lapse. See Billing Troubleshooting.

Billing section

From the tenant detail view, operators with platform.tenants.billing can:

ActionDescription
View subscriptionActive plan, expiry, usage
Change planAssign a different package
Adjust payment statusMark current, unpaid, trial
Set trial endExtend or shorten trial period
View payment historyManual payment records

Tenant users manage checkout through /billing in the tenant portal.

Custom domain

Branded patient portals can use a custom hostname (e.g. reports.mylab.pk):

StepEndpointAction
1. Set hostnamePOST /admin/tenants/{id}/custom-domain{ "hostname": "reports.mylab.pk" }
2. Configure DNSAdd CNAME/TXT records shown in response
3. VerifyPOST /admin/tenants/{id}/custom-domain/verifyConfirms DNS propagation
4. DisableDELETE /admin/tenants/{id}/custom-domainRemoves custom domain

DNS records include verification tokens. Until verified, the default slug URL remains active.

See also Public Portal: Custom Domain.

Tenant users

EndpointPurpose
GET /admin/tenants/{id}/usersList tenant staff
PUT /admin/tenants/{id}/users/{userId}/emailCorrect owner email

Impersonation

Support staff can sign in as the tenant owner for troubleshooting. See Impersonation.

Ease Lab — Cloud Pathology Lab Management