Early access

Apply

Documentation
Documentation/Managing Your App/Projects & Tenants

Projects & Tenants

How to create and manage the projects (your apps) and tenants (your customers) in your workspace day to day, which tenant each customer should live in, and the naming overload around the word 'tenant'.

Overview

Your workspace (the domain you chose at signup, the {domain} in API paths) holds your projects. A project is an app you build, or one environment of it. Tenants are the customers or organizations that use that app: each tenant's data and users are isolated from every other tenant's. This page is the day-to-day operator's guide: how to create a project, how to create and manage tenants, which tenant to put each customer in, and how project and tenant selection reconciles with login and API keys. Core Concepts covers the wider product model.
Most of the work below is done through dedicated REST endpoints (some project-and-tenant operations are not plain generic CRUD), and it uses the same domain, project and tenant fields you already pass to login.

A Naming Note: "Tenant" Means Two Things

Read this before you build anything cross-tenant

The word "tenant" is used two different ways across Supero, and mixing them up is the single easiest way to misdesign an isolation boundary.
  • In general SaaS usage (and in some platform-operation naming, such as registering a new customer organization), "tenant" loosely means your whole account, which this documentation calls your workspace or domain.
  • Inside a project, a Tenant is something narrower: one customer or organization of your app, with its own isolated data and its own users and API keys.
When you are deciding where to draw an isolation boundary for your own application, use the second meaning: a tenant is one of your app's customers (for example, one of your SaaS customers), not your whole Supero account. This page always uses "tenant" in that sense unless stated otherwise.

Managing Projects

A project is an isolated backend environment in your workspace: its own schemas, its own generated CRUD API, its own tenants. Most teams run one project per application, and separate projects per environment (development/staging/production) if they want hard isolation between them.

Creating a project

Projects are created with a dedicated create endpoint under the CRUD path (creating a project also provisions its default tenant):
bash
curl -X POST https://api.supero.dev/api/v1/crud/your-domain/project \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "storefront",
    "display_name": "Storefront",
    "description": "Customer-facing storefront app",
    "fq_name": ["your-domain", "storefront"],
    "parent_type": "domain"
  }'
name is slugified to lowercase letters, numbers, and hyphens. parent_type "domain" creates the project in your workspace. Creating a project requires the project:create permission, which domain_admin and platform-level roles hold by default.

Listing and reading projects

http
GET /api/v1/crud/your-domain/project           # list projects you can see
GET /api/v1/crud/your-domain/project/{uuid}    # read one project
A workspace-wide role (domain_admin, domain_user) sees every project in the workspace. A project-scoped role (project_admin, project_user, developer) or a tenant-scoped role (tenant_admin, tenant_user, viewer) sees only its own project.

Managing Tenants

Tenants have their own dedicated management endpoints (distinct from the generic CRUD path) because creating a tenant can also provision its first admin user in one call.

Creating a tenant

bash
curl -X POST https://api.supero.dev/api/v1/tenants \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "acme-corp",
    "display_name": "Acme Corporation",
    "project_uuid": "<your-project-uuid>",
    "create_admin_user": true,
    "admin_user": {
      "full_name": "Jane Smith",
      "email": "[email protected]",
      "send_activation_email": true
    }
  }'
name must be lowercase letters, numbers, and hyphens. If create_admin_user is true, the response includes the created admin user and whether activation is required; the admin user is created with the tenant_admin role for that tenant. Creating a tenant requires the tenant:create permission, which the domain_admin and project_admin roles hold; tenant-scoped roles (tenant_admin, tenant_user, viewer) cannot create tenants.

Listing, reading, updating, deleting

OperationRequest
ListGET /api/v1/tenants?project_uuid=...&status=...
Get oneGET /api/v1/tenants/{uuid}
UpdatePUT /api/v1/tenants/{uuid}
DeleteDELETE /api/v1/tenants/{uuid}
project_uuid defaults to your own project if omitted. A tenant-scoped caller (tenant_admin, tenant_user, viewer) sees only their own tenant in the list, regardless of filters -- unless they are a tenant_admin whose tenant is the project's default tenant, which grants project-wide visibility across every tenant. A tenant_user or viewer in the default tenant sees only the default tenant. See the default tenant section below.

Tenant lifecycle

A tenant carries a status field that moves through a small set of states via dedicated action endpoints:
StatusHow you get there
activeThe only status the create endpoint ever writes — it writes active in both branches, whether or not an admin user was created and still has to activate. Also the result of POST /api/v1/tenants/{uuid}/activate.
suspendedPOST /api/v1/tenants/{uuid}/suspend — temporarily blocks the tenant.
(back to active)POST /api/v1/tenants/{uuid}/unsuspend — only valid from suspended.
archivedPOST /api/v1/tenants/{uuid}/archive — a soft delete. The default tenant cannot be archived.
pending_setupDeclared in the status enum but written by no code path today. Treat it as reserved.
Those four values are the whole enum — there is no pending status, and ?status=pending will match nothing. Whether an admin user still has to activate their account is carried separately, as activation_status (pending or active) on the create response and on the tenant record. Filter on that, not on status, if you are looking for tenants awaiting activation.
There is also POST /api/v1/tenants/{uuid}/resend-activation to re-send the admin user's activation email.

From the Python SDK

The Python SDK does not wrap tenant/project management in a separate typed client — use the generic CRUD manager (for reading projects/tenants as records) or the connected session's HTTP helpers for the dedicated tenant-lifecycle endpoints above:
python
import supero

org = supero.login(
    domain_name="your-domain",
    email="[email protected]",
    password="your-password",
)

# Read/list via the generic CRUD surface
projects = org.crud.list("project")
tenants = org.crud.list("tenant")

# Dedicated tenant-management endpoints via the connected session
resp = org.post("/api/v1/tenants", json={
    "name": "acme-corp",
    "display_name": "Acme Corporation",
    "project_uuid": projects[0]["uuid"],
})

Choosing a Tenant per Customer: the Default Project and Tenant

Every new workspace comes with a built-in default project and default tenant, named default-project and default-tenant, and your first admin user (role domain_admin) is placed there. Every project you create also gets its own default-tenant. These are system resources for your own staff, not a template for your customers' tenants.

system:read

The built-in default project and tenant are hidden from ordinary project/tenant listings. Only roles that hold the system:read permission (workspace-wide roles and above) can see them.
In practice:
  • Create one named tenant per customer, inside a dedicated project for your app. Do not build your app's tenants in the workspace's built-in default project, and do not put customers in any project's default tenant: everyone placed there shares its records, and a tenant_admin or developer there can read every tenant in the project.
  • Cross-tenant visibility across a project is a property of the workspace-wide and project-wide roles (domain_admin, domain_user, project_admin, project_user). developer is not among them despite its project-level name — it is confined to its own tenant. Build cross-tenant tooling on one of those roles rather than a tenant-scoped role. See the Roles & Permissions Reference for the full role set.

Who Can See Across Tenants

Tenant isolation is the default: a tenant-scoped user or API key reads and writes only its own tenant's records, and a request that targets another tenant is refused. Seeing across tenants is a property of the role, not something you configure per tenant:
RoleSees
domain_admin / domain_userEvery project and every tenant in the workspace.
project_admin / project_userEvery tenant inside their own project (not other projects).
developerIts own tenant only — despite the project-level name.
tenant_admin / tenant_user / viewerOnly their own tenant.
This is why tenant_admin — despite the name — does not see sibling tenants: tenant_admin manages one tenant, not the project. The exception is membership of the default tenant: a tenant_admin or developer account whose tenant is default-tenant gets project-wide cross-tenant access, so a tenant_admin in default-tenant does see every sibling tenant. This does not apply to tenant_user, viewer, or a custom role based on either. Those accounts stay in default-tenant, and a login or switch-project that names another tenant is refused with 403 "You do not have access to that tenant". There is one narrow exception, kept because older SDK setups placed seed users in the workspace's built-in default project and tenant: an account whose home is there may sign in to another project's default-tenant, and once there it sees only that default-tenant's records. It is still refused for any other tenant. SDK 3.7.15 places new seed users in the app's project instead. If you need a support/ops role that spans tenants within one project without full project_admin rights, use project_user (project-wide read plus CRUD across every tenant in the project, without admin actions).

Reconciling with Login and API Keys

The project and tenant you create above are exactly the project and tenant fields you pass to login — there is no separate identifier to look up.
http
POST /api/v1/auth/login
{
  "domain": "your-domain",
  "email": "[email protected]",
  "password": "...",
  "project": "storefront",
  "tenant": "acme-corp"
}
Omitting project/tenant resolves to that user's own home project and tenant, not the workspace's built-in default project and tenant (unless that genuinely is where the user lives). A logged-in user who is authorized to work in more than one project can switch without a full re-login using POST /api/v1/auth/switch-project, which re-issues tokens scoped to the new project/tenant context.
An API key (X-API-Key header, opaque secret starting ak_) is issued for one specific tenant, not for a project or a user, so a key is scoped to one workspace, project and tenant the same way a login session is. Treat the key value itself as an opaque secret: do not parse or derive scope from its contents; read the scope back from the authenticated session (GET /api/v1/auth/session or /api/v1/auth/me) instead.

Bearer vs X-API-Key

Never send an API key in the Authorization: Bearer header. Bearer is for JWT access tokens from login; API keys go in X-API-Key.

Next Steps