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

ℹ️

In case you are using multiple tenants in your application, then it's highly recommended to activate this feature in ROQ as well. This way you can define access rights accordingly, and don't risk to leak data accross tenants.

(1) Active multi-tenancy in ROQ Console

Before you can start grouping your users into tenants, you need to activate this feature in ROQ Console (opens in a new tab).

(2) Create new tenants via API

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

(3) Assign users to tenants

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