Skip to content

client.tenants

Bases: SyncResource

Sync tenants namespace (client.tenants).

health

health() -> HealthStatus

Probe API liveness. Returns HealthStatus(status="ok") when up.

Unauthenticated and not tenant-scoped; safe to call before any workspace exists.

create

create(*, slug: str, name: str, owner: dict[str, Any], bootstrap_secret: str | None = None) -> Tenant

Provision a new workspace and its owner account (OPERATOR-only; 201).

Requires the deployment's bootstrap secret (ADR-0116) — pass it here or set SUPERB_AI_BOOTSTRAP_SECRET. Without it the endpoint answers 404 for everyone (fail-closed). Regular users create workspaces in-app via :meth:Account.create_tenant after signing up.

Parameters:

Name Type Description Default
slug str

URL-safe unique id — lowercase alphanumeric with single hyphens (e.g. "acme", "acme-corp"). Reserved slugs are rejected.

required
name str

human-readable display name.

required
owner dict[str, Any]

the initial owner account — a dict with email, first_name, last_name, and password (the owner signs in immediately via the hosted IdP with this password).

required
bootstrap_secret str | None

operator secret; falls back to the SUPERB_AI_BOOTSTRAP_SECRET env var.

None

Raises:

Type Description
NotFoundError

missing/wrong bootstrap secret (the gate is indistinguishable from a missing route by design).

ConflictError

the slug is already taken (TENANT_SLUG_TAKEN).

UnprocessableError

invalid slug/name/owner (e.g. reserved slug, malformed email, password below the minimum length).

Response models

Models returned by client.tenants methods (fields, types, and what each means).

Tenant + platform-meta models (workspace provisioning and the health probe).

Bootstrap surface: POST /tenants is one of the few unauthenticated routes (it mints the very first tenant + owner), and GET /health is the liveness probe. Both live on the tenants namespace in the SDK.

HealthStatus

Bases: BaseModel

Liveness-probe payload — {"status": "ok"} when the API is up.

TenantOwner

Bases: BaseModel

The owner user minted alongside a new tenant (compact identity view).

Tenant

Bases: BaseModel

A workspace: its URL-safe slug, display name, and initial owner.