Create a new workspace for the current account
POST/api/tenants
Creates a NEW tenant owned + administered by the CURRENT account (Faz 5E). The account identity comes from the session, never the request.
FREE LIMIT: an account may own at most ONE free-plan tenant. Requesting the
free plan when one already exists is rejected 422 with
error: free_tenant_limit.
- Free plan (allowed) → the tenant is created on the free/trial baseline and
the session is switched into it immediately;
checkout_urlisnull(201). - Paid plan under the live Stripe provider → the tenant is created on the
free/trial baseline and a hosted Stripe Checkout URL is returned
(
checkout_url); the session is NOT switched and no quota is granted until the webhook confirms payment (202). Under the fake provider the paid plan is provisioned directly and the session is switched (201).
Request
Responses
- 201
- 202
- 401
- 422
Tenant created and the session switched into it (free / fake-provider paid).
Paid plan under live Stripe — a hosted Checkout URL is returned and the session is NOT switched (pay first).
Not authenticated. code: account_disabled means the member's seat was deactivated in this workspace: the session is over even though the token was not revoked (clients sign out and clean up).
Validation failed, or the free-tenant limit was hit (error: free_tenant_limit), or an unknown plan (error: unknown_plan).