Account
Account
Section titled “Account”Defines a user or group account for authentication and email access.
This object can be configured from the WebUI under Management › Directory › Groups Management › Directory › Accounts
Fields
Section titled “Fields”Account is a multi-variant object: each instance has an @type discriminator selecting one of the variants below, and each variant carries its own set of fields.
@type: "User"
Section titled “@type: "User"”User account
Type:
EmailLocalPart· requiredName of the account, typically an email address local part.
domainId
Section titled “domainId”Type:
Id<Domain>· requiredIdentifier for the domain this account belongs to. This is used to determine the email address of the account, which is formed as name@domain.
emailAddress
Section titled “emailAddress”Type:
EmailAddress· server-setEmail address for the user account, formed as name@domain.
credentials
Section titled “credentials”Type:
Credential[]List of credential objects representing authentication methods for the account
createdAt
Section titled “createdAt”Type:
UTCDateTime· server-setCreation date of the account
memberGroupIds
Section titled “memberGroupIds”Type:
Id<Account>[]List of groups that this account is a member of
memberTenantId
Section titled “memberTenantId”Type:
Id<Tenant>?Identifier for the tenant this account belongs to
Type:
UserRoles· requiredRoles assigned to this user account
permissions
Section titled “permissions”Type:
Permissions· requiredPermissions assigned to this account
quotas
Section titled “quotas”Type:
Map<StorageQuota, UnsignedInt>Quotas for different object types within this account
usedDiskQuota
Section titled “usedDiskQuota”Type:
Size· server-setAmount of disk space currently used by this account (bytes)
aliases
Section titled “aliases”Type:
EmailAlias[]List of email aliases for the account
description
Section titled “description”Type:
String?Description of the account
locale
Section titled “locale”Type:
Locale· default:"en_US"Preferred locale for the account
timeZone
Section titled “timeZone”Type:
TimeZone?Preferred time zone for the account
encryptionAtRest
Section titled “encryptionAtRest”Type:
EncryptionAtRest· requiredEncryption-at-rest settings for the account
@type: "Group"
Section titled “@type: "Group"”Group account
Type:
EmailLocalPart· requiredName of the group, typically an email address local part.
domainId
Section titled “domainId”Type:
Id<Domain>· requiredIdentifier for the domain this group belongs to. This is used to determine the email address of the group, which is formed as name@domain.
emailAddress
Section titled “emailAddress”Type:
EmailAddress· server-setEmail address of the group, formed as name@domain.
description
Section titled “description”Type:
String?Description of the group
createdAt
Section titled “createdAt”Type:
UTCDateTime· server-setCreation date of the account
memberTenantId
Section titled “memberTenantId”Type:
Id<Tenant>?Identifier for the tenant this group belongs to
Type:
Roles· requiredRoles assigned to this group
quotas
Section titled “quotas”Type:
Map<StorageQuota, UnsignedInt>Quotas for different object types within this group
usedDiskQuota
Section titled “usedDiskQuota”Type:
Size· server-setAmount of disk space currently used by this account (bytes)
permissions
Section titled “permissions”Type:
Permissions· requiredPermissions assigned to this group
aliases
Section titled “aliases”Type:
EmailAlias[]List of email aliases for the group
locale
Section titled “locale”Type:
Locale· default:"en_US"Preferred locale for the group
timeZone
Section titled “timeZone”Type:
TimeZone?Preferred time zone for the account
JMAP API
Section titled “JMAP API”The Account object is available via the urn:stalwart:jmap capability.
x:Account/get
Section titled “x:Account/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysAccountGet permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:Account/get", { "ids": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:Account/set
Section titled “x:Account/set”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.
Create
Section titled “Create”This operation requires the sysAccountCreate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:Account/set", { "create": { "new1": { "@type": "User", "aliases": {}, "credentials": {}, "domainId": "<Domain id>", "encryptionAtRest": { "@type": "Disabled" }, "memberGroupIds": {}, "name": "alice", "permissions": { "@type": "Inherit" }, "quotas": {}, "roles": { "@type": "User" } } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Update
Section titled “Update”This operation requires the sysAccountUpdate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:Account/set", { "update": { "id1": { "description": "updated value" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Destroy
Section titled “Destroy”This operation requires the sysAccountDestroy permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:Account/set", { "destroy": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:Account/query
Section titled “x:Account/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysAccountQuery permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:Account/query", { "filter": {} }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'The x:Account/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):
| Condition | Kind |
|---|---|
text | text |
name | text |
domainId | id of Domain |
memberTenantId | id of Tenant |
memberGroupIds | id of Account/Group |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get Account id1Create
Section titled “Create”stalwart-cli create Account/User \ --field name=alice \ --field 'domainId=<Domain id>' \ --field 'credentials={}' \ --field 'memberGroupIds={}' \ --field 'roles={"@type":"User"}' \ --field 'permissions={"@type":"Inherit"}' \ --field 'quotas={}' \ --field 'aliases={}' \ --field 'encryptionAtRest={"@type":"Disabled"}'stalwart-cli query AccountUpdate
Section titled “Update”stalwart-cli update Account id1 --field description='updated value'Delete
Section titled “Delete”stalwart-cli delete Account --ids id1Nested types
Section titled “Nested types”Credential
Section titled “Credential”Defines an authentication credential for an account.
Password: Password for authenticating to the account. Carries the fields ofPasswordCredential.AppPassword: App password for third-party applications. Carries the fields ofSecondaryCredential.ApiKey: API key for programmatic access. Carries the fields ofSecondaryCredential.
PasswordCredential
Section titled “PasswordCredential”Password-based authentication credential.
secret
Section titled “secret”Type:
String· required · secretSecret value of the account
otpAuth
Section titled “otpAuth”Type:
Uri?· secretOTP authentication URI for the account
expiresAt
Section titled “expiresAt”Type:
UTCDateTime?Expiration date of the credential
allowedIps
Section titled “allowedIps”Type:
IpMask[]List of allowed IP addresses or CIDR ranges for this credential
SecondaryCredential
Section titled “SecondaryCredential”App password or API key credential for programmatic access.
description
Section titled “description”Type:
String· requiredDescription of the credential
secret
Section titled “secret”Type:
String· read-only · server-set · secretSecret value of the credential
createdAt
Section titled “createdAt”Type:
UTCDateTime· read-only · server-setCreation date of the credential
expiresAt
Section titled “expiresAt”Type:
UTCDateTime?Expiration date of the credential
permissions
Section titled “permissions”Type:
CredentialPermissions· requiredList of permissions assigned to this credential
allowedIps
Section titled “allowedIps”Type:
IpMask[]List of allowed IP addresses or CIDR ranges for this credential
CredentialPermissions
Section titled “CredentialPermissions”Permission assignment mode for a credential.
Inherit: Same permissions as account. No additional fields.Disable: Disable some permissions. Carries the fields ofCredentialPermissionsList.Replace: Replace all permissions. Carries the fields ofCredentialPermissionsList.
CredentialPermissionsList
Section titled “CredentialPermissionsList”List of permissions to assign to a credential.
permissions
Section titled “permissions”Type:
Permission[]List of permissions to assign.
UserRoles
Section titled “UserRoles”Role assignment for user accounts.
User: User role. No additional fields.Admin: Administrator role. No additional fields.Custom: Custom role. Carries the fields ofCustomRoles.
CustomRoles
Section titled “CustomRoles”Custom role assignment with specific role references.
roleIds
Section titled “roleIds”Type:
Id<Role>[]List of roles assigned to this principal.
Permissions
Section titled “Permissions”Permission assignment mode for accounts, groups, and tenants.
Inherit: Inherited permissions. No additional fields.Merge: Permissions are combined with inherited permissions. Carries the fields ofPermissionsList.Replace: Permissions replace all inherited permissions. Carries the fields ofPermissionsList.
PermissionsList
Section titled “PermissionsList”Explicit permission grants and denials.
enabledPermissions
Section titled “enabledPermissions”Type:
Permission[]List of permissions that are explicitly enabled.
disabledPermissions
Section titled “disabledPermissions”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.
EmailAlias
Section titled “EmailAlias”Defines an email alias for an account or mailing list.
enabled
Section titled “enabled”Type:
Boolean· default:trueWhether this email alias is enabled
Type:
EmailLocalPart· requiredThe local part of the email alias (the part before the @ symbol)
domainId
Section titled “domainId”Type:
Id<Domain>· requiredIdentifier for the domain of the email alias (the part after the @ symbol).
description
Section titled “description”Type:
String?Description of the email alias
EncryptionAtRest
Section titled “EncryptionAtRest”Encryption-at-rest algorithm selection.
Disabled: Disabled. No additional fields.Aes128: AES-128. Carries the fields ofEncryptionSettings.Aes256: AES-256. Carries the fields ofEncryptionSettings.
EncryptionSettings
Section titled “EncryptionSettings”Encryption-at-rest settings for an account.
publicKey
Section titled “publicKey”Type:
Id<PublicKey>· requiredPublic key used for encrypting emails
encryptOnAppend
Section titled “encryptOnAppend”Type:
Boolean· default:falseWhether to encrypt emails when they are appended to mailboxes
allowSpamTraining
Section titled “allowSpamTraining”Type:
Boolean· default:falseWhether to allow training the spam classifier with plaintext emails before encryption
Role assignment for groups and tenants.
Default: Default role. No additional fields.Custom: Custom role. Carries the fields ofCustomRoles.
StorageQuota
Section titled “StorageQuota”| Value | Label |
|---|---|
maxEmails | Maximum number of emails |
maxMailboxes | Maximum number of mailboxes |
maxEmailSubmissions | Maximum number of email submissions |
maxEmailIdentities | Maximum number of email identities |
maxParticipantIdentities | Maximum number of participant identities |
maxSieveScripts | Maximum number of Sieve scripts |
maxPushSubscriptions | Maximum number of push subscriptions |
maxCalendars | Maximum number of calendars |
maxCalendarEvents | Maximum number of calendar events |
maxCalendarEventNotifications | Maximum number of calendar event notifications |
maxAddressBooks | Maximum number of address books |
maxContactCards | Maximum number of contact cards |
maxFiles | Maximum number of files |
maxFolders | Maximum number of folders |
maxMaskedAddresses | Maximum number of masked email addresses |
maxAppPasswords | Maximum number of app passwords |
maxApiKeys | Maximum number of API keys |
maxPublicKeys | Maximum number of public keys |
maxDiskQuota | Maximum disk space allocated (bytes) |