Multi-tenancy
Overview

Multi-tenancy

Introduction

In B2B SaaS applications, all users are usually grouped into tenants. Each of your business customers is represented as a tenant. The related users and all the data are fully isolated.

You may use another term, like organization, workspace, or team. For instance, if you are using Slack, then you know that your team members are grouped into a so-called workspace. A tenant is usually created when the first user signs up.

How to Use Multi-Tenancy

ℹ️

Suppose you are using multiple tenants in your application. In that case, it's also highly recommended to activate this feature in ROQ. This way, you can define access rights accordingly and don't risk leaking data across tenants.

In the AI generated application, when registering or signing up, a tenant is automatically created. However, tenants can also be manually created and users can be assigned to them using the API.

Active Multi-Tenancy

Before you can start grouping your users into tenants, you need to activate this feature in ROQ Console. Please read this documentation on how to activate multi-tenancy.

API

ROQ offers simple APIs for managing tenant data, including creation, updates, and querying. For API documentation and code samples, visit Multi-tenancy api.

Create Tenants via API

New tenants can be created programmatically using the createTenant() API.

Assign Users to Tenants via API

createTenant() returns an id that is used when you create users using createUser() API.