Skip to content

Tenants

Tenants represent isolated customer workspaces within your application. Each tenant has its own set of users, configuration, and data — making them the foundational building block for multi-tenant SaaS applications built on The Bridge.


Retrieve a list of all tenants registered under your application.

GET https://api.thebridge.dev/account/tenant

HTTP 200 — Array of tenant objects.

Request example

curl --request GET 'https://api.thebridge.dev/account/tenant' \
--header 'x-api-key: YOUR_APP_API_KEY'

Response example:

[
{
"id": "624c14cc0c01e70033356285",
"plan": "TEAM",
"trial": false,
"paymentStatus": {
"shouldSelectPlan": false,
"shouldSetupPayments": false,
"provider": "STRIPE",
"paymentsEnabled": true
},
"mfa": false,
"locale": "en",
"name": "Nebulr AB",
"logo": "",
"metadata": {},
"onboarded": true,
"createdAt": "2022-04-05T10:07:08.235Z"
}
]
GET Try it out
GET https://api.thebridge.dev/account/tenant
Stored in session memory only. Never persisted.

Retrieve a single tenant by its unique identifier.

GET https://api.thebridge.dev/account/tenant/byId/:TENANT_ID

HTTP 200 — Tenant object.

Request example

curl --request GET 'https://api.thebridge.dev/account/tenant/byId/TENANT_ID' \
--header 'x-api-key: YOUR_APP_API_KEY'

Response example:

{
"id": "624c14cc0c01e70033356285",
"plan": "TEAM",
"trial": false,
"paymentStatus": {
"shouldSelectPlan": false,
"shouldSetupPayments": false,
"provider": "STRIPE",
"paymentsEnabled": true
},
"mfa": false,
"locale": "en",
"name": "Nebulr AB",
"logo": "",
"metadata": {},
"onboarded": true,
"createdAt": "2022-04-05T10:07:08.235Z"
}
GET Try it out
GET https://api.thebridge.dev/account/tenant/byId/:TENANT_ID
Stored in session memory only. Never persisted.
The unique ID of the tenant

Create a new tenant workspace. An owner must be specified to act as the initial administrator of the tenant.

POST https://api.thebridge.dev/account/tenant

Body Parameters

ParameterTypeRequiredDescription
ownerobjectRequiredThe initial owner of the tenant. Must include email (string, required), firstName (string, required), and lastName (string, required).
namestringOptionalDisplay name of the tenant
planstringOptionalThe subscription plan key to assign
localestringOptionalLocale code, e.g. en, sv
logostringOptionalURL to the tenant logo
onboardedbooleanOptionalWhether the tenant has completed onboarding
metadataRecord<string, any>OptionalArbitrary key-value metadata to store on the tenant

HTTP 200 — Returns the created tenant object.

Request example

curl --request POST 'https://api.thebridge.dev/account/tenant' \
--header 'x-api-key: YOUR_APP_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "owner": {
    "email": "jane@example.com",
    "firstName": "Jane",
    "lastName": "Doe"
  },
  "name": "Nebulr AB",
  "plan": "TEAM",
  "locale": "en"
}'

Response example:

{
"id": "624c14cc0c01e70033356285",
"plan": "TEAM",
"trial": false,
"paymentStatus": {
"shouldSelectPlan": false,
"shouldSetupPayments": false,
"provider": "STRIPE",
"paymentsEnabled": true
},
"mfa": false,
"locale": "en",
"name": "Nebulr AB",
"logo": "",
"metadata": {},
"onboarded": true,
"createdAt": "2022-04-05T10:07:08.235Z"
}
POST Try it out
POST https://api.thebridge.dev/account/tenant
Stored in session memory only. Never persisted.

Update properties of an existing tenant.

PUT https://api.thebridge.dev/account/tenant/:TENANT_ID

Body Parameters

ParameterTypeRequiredDescription
namestringOptionalDisplay name of the tenant
localestringOptionalLocale code, e.g. en, sv
logostringOptionalURL to the tenant logo
mfabooleanOptionalEnable or disable multi-factor authentication for the tenant
onboardedbooleanOptionalWhether the tenant has completed onboarding
federationConnectionstringOptionalFederation connection identifier for SSO
metadataRecord<string, any>OptionalArbitrary key-value metadata to store on the tenant

HTTP 200 — Returns the updated tenant object.

Request example

curl --request PUT 'https://api.thebridge.dev/account/tenant/TENANT_ID' \
--header 'x-api-key: YOUR_APP_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "Nebulr AB",
  "locale": "sv",
  "onboarded": true
}'

Response example:

{
"id": "624c14cc0c01e70033356285",
"plan": "TEAM",
"trial": false,
"paymentStatus": {
"shouldSelectPlan": false,
"shouldSetupPayments": false,
"provider": "STRIPE",
"paymentsEnabled": true
},
"mfa": false,
"locale": "sv",
"name": "Nebulr AB",
"logo": "",
"metadata": {},
"onboarded": true,
"createdAt": "2022-04-05T10:07:08.235Z"
}
PUT Try it out
PUT https://api.thebridge.dev/account/tenant/:TENANT_ID
Stored in session memory only. Never persisted.
The unique ID of the tenant