Skip to Content
🎉 New release with new features and improvements! V0.0.6 Release →

Tenants Service

Maps to the Tenants API. Requires appropriate admin or tenant permissions.

Tenant header

Use Configuration withTenant() when a BSH_ADMIN must scope requests:

new BshEngine({ host: 'https://your-instance.com', jwtToken }) .withTenant(async () => selectedTenantId);

See Manage Tenants — X-Tenant-Id.

Methods

MethodDescription
create({ payload })Create tenant
update({ payload })Update tenant
getById({ id })Get by id
list({ page, size, sort, filter })List tenants
search({ payload })Search tenants
count() / countFiltered({ payload })Count
activate({ id }) / deactivate({ id }) / block({ id })Status changes
assignAdmin({ id, adminId })Assign tenant admin
delete({ id })Delete tenant
await bshEngine.tenants.search({ payload: { pagination: { page: 1, size: 10 }, }, });