CR Bee Docs

Multi-Tenancy

How tenant resolution works with subdomains and custom domains

CR Bee is a multi-tenant platform. Each API request is scoped to a specific tenant based on the request URL.

Tenant Resolution

The API resolves the tenant from the request URL:

Subdomain (Default)

Each tenant gets a subdomain on crbeeapp.com:

https://your-slug.crbeeapp.com/api/v1/...

Custom Domain

Tenants can configure a custom domain:

https://rentals.yourbusiness.com/api/v1/...

Custom domains are mapped via the TenantDomain model and DNS CNAME records.

Development

In local development, tenant resolution supports:

  • Query parameter: ?tenant=your-slug
  • Header: X-Tenant-Slug: your-slug
  • Cookie: Set via the query parameter, persisted for subsequent requests

Data Isolation

All API responses are scoped to the resolved tenant:

  • GET /api/v1/cars returns only that tenant's vehicles
  • POST /api/v1/bookings creates a booking under that tenant
  • API keys are tenant-scoped — a key from one tenant cannot access another's data

Base URL Pattern

Always use the tenant-specific URL as the base for API requests:

https://{tenant-slug}.crbeeapp.com/api/v1/

Do not use a generic base URL — every request must resolve to a specific tenant.

On this page