Skip to main content

List Tenants

Retrieve all tenants with pagination and sorting support.
GET /api/v1/tenants?pageNumber=1&pageSize=10&sort=name

Query Parameters

pageNumber
integer
default:"1"
Page number for pagination
pageSize
integer
default:"10"
Number of items per page
sort
string
Sort field and direction (e.g., “name”, “name desc”)

Authorization

Requires Permissions.Multitenancy.View permission.

Response

Returns a paginated list of tenants.
data
array
Array of tenant objects
id
string
Unique tenant identifier
name
string
Tenant display name
adminEmail
string
Administrator email address
isActive
boolean
Whether the tenant is currently active
validUpto
datetime
Subscription expiration date
connectionString
string
Database connection string (if using separate database)
issuer
string
JWT issuer for the tenant
pageNumber
integer
Current page number
pageSize
integer
Items per page
totalCount
integer
Total number of tenants
totalPages
integer
Total number of pages
{
  "data": [
    {
      "id": "root",
      "name": "Root Tenant",
      "adminEmail": "[email protected]",
      "isActive": true,
      "validUpto": "2026-12-31T23:59:59Z",
      "connectionString": null,
      "issuer": "https://api.example.com"
    },
    {
      "id": "acme-corp",
      "name": "Acme Corporation",
      "adminEmail": "[email protected]",
      "isActive": true,
      "validUpto": "2026-06-30T23:59:59Z",
      "connectionString": "Server=db.acme.com;Database=AcmeDb;",
      "issuer": "https://acme.example.com"
    }
  ],
  "pageNumber": 1,
  "pageSize": 10,
  "totalCount": 2,
  "totalPages": 1
}

Create Tenant

Create a new tenant with provisioning workflow.
POST /api/v1/tenants
Content-Type: application/json

{
  "id": "new-tenant",
  "name": "New Tenant",
  "connectionString": null,
  "adminEmail": "[email protected]",
  "issuer": "https://newtenant.example.com"
}

Request Body

id
string
required
Unique tenant identifier (slug format recommended)
name
string
required
Display name for the tenant
adminEmail
string
required
Administrator email address for the tenant
connectionString
string
Custom database connection string. Leave null to use shared database with tenant isolation.
issuer
string
JWT issuer URL for the tenant’s authentication

Authorization

Requires Permissions.Multitenancy.Create permission.

Response

Returns provisioning status for the new tenant.
id
string
The created tenant identifier
provisioningCorrelationId
string
Correlation ID for tracking the provisioning workflow
status
string
Current provisioning status (e.g., “Pending”, “InProgress”, “Completed”)
{
  "id": "new-tenant",
  "provisioningCorrelationId": "550e8400-e29b-41d4-a716-446655440000",
  "status": "InProgress"
}
Tenant provisioning is an asynchronous process. Use the provisioningCorrelationId to check status via the provisioning status endpoint.

Build docs developers (and LLMs) love