Skip to content

Tenant management ​

IDVIZE is multi-tenant. Every object — application, account, identity, assessment, execution session — belongs to exactly one tenant, enforced by row-level security in PostgreSQL.

Listing tenants ​

Requires: tenants.manage permission (PlatformAdmin only).

bash
GET /v1/tenants

Returns every tenant with its name, domain, status and plan. Each tenant entry includes aggregate statistics (user count, application count) when available.

Creating a tenant ​

Requires: PlatformAdmin role, a valid API key, and a JWT.

bash
curl -X POST http://localhost:3001/v1/tenants \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Authorization: Bearer YOUR_JWT" \
  -d '{
    "name": "Acme Corp",
    "domain": "acme.com",
    "plan": "enterprise"
  }'

The tenant is immediately usable. Creating a tenant also creates its first admin user. Users created under this tenant see only its data.

Tenant fields ​

FieldTypeDescription
namestringDisplay name
domainstringPrimary email domain (used for user association)
planenterprise | professional | trialCommercial plan tier
statusactive | suspended | trialCurrent lifecycle state
slugstringURL-safe identifier, derived from name

Viewing a tenant ​

bash
GET /v1/tenants/:tenantId

Returns the tenant's details and statistics. Requires tenants.manage.

Any authenticated user can view their own tenant:

bash
GET /v1/tenants/me

Tenant settings ​

Each tenant has configurable settings that govern its security posture and operational limits:

bash
# View settings
GET /v1/tenants/me/settings

# Update settings (requires tenants.settings.update)
PATCH /v1/tenants/me/settings
SettingTypeDescription
mfaRequiredbooleanWhether MFA is required for all users in this tenant
sessionTimeoutSecondsnumberJWT session duration override
allowedAuthProvidersstring[]Which authentication providers are permitted (local, oidc, saml)
maxUsersnumberMaximum users allowed in the tenant
maxAppsnumberMaximum managed applications
remediationobjectRemediation-specific settings

Other tenant-level configuration ​

SettingConfigured viaPurpose
Automation policyAutomation policyGoverns whether agents observe, recommend, require approval, or run autonomously for each control, risk tier and environment
Control baselineControl baselinesThe default set of controls required for each object type and risk tier
Commercial grantsAPI referenceWhich product capabilities are available and their limits

Tenant isolation ​

Tenant isolation is enforced at three layers:

  1. JWT claims. Every authenticated request carries a tenantId in the JWT. The tenantContext middleware extracts it and makes it available to all downstream handlers.
  2. PostgreSQL RLS. The application-pool connection sets app.current_tenant via SET LOCAL inside every transaction. Row-level security policies on every tenant-scoped table filter reads and writes to the current tenant.
  3. Static analysis. A CI governance ratchet (check-tenant-scoping) scans every repository and query file to ensure no SQL query on a tenant-scoped table omits the tenant predicate.

There are currently 23 dedicated cross-tenant test files with over 200 probes that verify one tenant's data is invisible to another.

TIP

Tenant isolation is not an application-level convention — it is a database-level guarantee. Even a bug in a controller cannot read another tenant's data, because the PostgreSQL session variable restricts what the query can see.

Suspending a tenant ​

There is no explicit suspend endpoint. To suspend a tenant's execution capabilities while keeping assessment data intact:

  1. Suspend commercial grants. Set the tenant's commercial grants to suspended via PUT /v1/commercial/grants/:id. Assessment (read-only) continues; execution (write) is blocked by the commercial gate.
  2. Deactivate users. Set individual user statuses to suspended via PATCH /v1/security/auth/users/:userId/status to prevent sign-in.

Assessment data, audit logs and the full evaluation history are preserved regardless of tenant or user status. No data is deleted by suspension.