Skip to content

Tenant

Defines a tenant for multi-tenant environments with isolated resources and quotas.

This object can be configured from the WebUI under Management › Directory › Tenants

Type: String · required

Name of the tenant

Type: UTCDateTime · server-set

Creation date of the tenant

Type: String?

URL or base64-encoded image representing the tenant

Type: Roles · required

Roles assigned to this tenant

Type: Permissions · required

Permissions assigned to this tenant

Type: Map<TenantStorageQuota, UnsignedInt>

Quotas for different object types within this tenant

Type: Size · server-set

Amount of disk space currently used by this tenant (bytes)

The Tenant object is available via the urn:stalwart:jmap capability.

This is a standard Foo/get method as defined in RFC 8620, Section 5.1.

This method requires the sysTenantGet permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Tenant/get",
{
"ids": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This is a standard Foo/set method as defined in RFC 8620, Section 5.3.

Supports create, update, and destroy operations in a single call.

This operation requires the sysTenantCreate permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Tenant/set",
{
"create": {
"new1": {
"name": "Example",
"permissions": {
"@type": "Inherit"
},
"quotas": {},
"roles": {
"@type": "Default"
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysTenantUpdate permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Tenant/set",
{
"update": {
"id1": {
"name": "updated value"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysTenantDestroy permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Tenant/set",
{
"destroy": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This is a standard Foo/query method as defined in RFC 8620, Section 5.5.

This method requires the sysTenantQuery permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Tenant/query",
{
"filter": {
"text": "example"
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

The x:Tenant/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):

ConditionKind
texttext

stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.

Terminal window
stalwart-cli get Tenant id1
Terminal window
stalwart-cli create Tenant \
--field name=Example \
--field 'roles={"@type":"Default"}' \
--field 'permissions={"@type":"Inherit"}' \
--field 'quotas={}'
Terminal window
stalwart-cli query Tenant
stalwart-cli query Tenant --where text=example
Terminal window
stalwart-cli update Tenant id1 --field name='updated value'
Terminal window
stalwart-cli delete Tenant --ids id1

Role assignment for groups and tenants.

  • Default: Default role. No additional fields.
  • Custom: Custom role. Carries the fields of CustomRoles.

Custom role assignment with specific role references.

Type: Id<Role>[]

List of roles assigned to this principal.

Permission assignment mode for accounts, groups, and tenants.

  • Inherit: Inherited permissions. No additional fields.
  • Merge: Permissions are combined with inherited permissions. Carries the fields of PermissionsList.
  • Replace: Permissions replace all inherited permissions. Carries the fields of PermissionsList.

Explicit permission grants and denials.

Type: Permission[]

List of permissions that are explicitly enabled.

Type: Permission[]

List of permissions that are explicitly disabled, even if they would be inherited through other roles or groups. This takes precedence over enabled permissions.

ValueLabel
maxAccountsMaximum number of accounts
maxGroupsMaximum number of groups
maxDomainsMaximum number of domains
maxMailingListsMaximum number of mailing lists
maxRolesMaximum number of roles
maxOauthClientsMaximum number of OAuth clients
maxDkimKeysMaximum number of DKIM keys
maxDnsServersMaximum number of DNS servers
maxDirectoriesMaximum number of external directories
maxAcmeProvidersMaximum number of ACME providers
maxDiskQuotaMaximum disk space allocated (bytes)