Provision a tenant (server-side WorkOS org creation)
Bootstraps a property group + first property for the caller. Requires a WorkOS session token (SPA surface).
Two paths, chosen from the verified token claims:
-
Org-less (new self-serve user): the server creates a WorkOS organization, adds the caller as
owner, then bootstraps the tenant. Sendorganization_name. Idempotent per user — an existing membership is reused, and a second call returns409. -
Org-present (invited admin finishing setup): the org comes from the token’s
org_idclaim (owner/admin only);organization_nameis ignored.
After a 201, the SPA re-mints its token against the returned organization_id so the new org claim is present on the next request.
Authorizations
Authorization: Bearer <token>. Token types resolve to the same scoped credential: a user-generated API key (casa_…, from Account settings — recommended for machines and MCP clients), a WorkOS AuthKit session JWT (the web app; org and role come from verified token claims), or a static token. API keys are group-scoped, optionally pinned to one property at creation. MCP OAuth connector tokens authenticate the MCP server only and are rejected on these REST routes.
Body
Response
Tenant created.