Skip to content

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

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.

User account

Type: EmailLocalPart · required

Name of the account, typically an email address local part.

Type: Id<Domain> · required

Identifier for the domain this account belongs to. This is used to determine the email address of the account, which is formed as name@domain.

Type: EmailAddress · server-set

Email address for the user account, formed as name@domain.

Type: Credential[]

List of credential objects representing authentication methods for the account

Type: UTCDateTime · server-set

Creation date of the account

Type: Id<Account>[]

List of groups that this account is a member of

Type: Id<Tenant>?

Identifier for the tenant this account belongs to

Type: UserRoles · required

Roles assigned to this user account

Type: Permissions · required

Permissions assigned to this account

Type: Map<StorageQuota, UnsignedInt>

Quotas for different object types within this account

Type: Size · server-set

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

Type: EmailAlias[]

List of email aliases for the account

Type: String?

Description of the account

Type: Locale · default: "en_US"

Preferred locale for the account

Type: TimeZone?

Preferred time zone for the account

Type: EncryptionAtRest · required

Encryption-at-rest settings for the account

Group account

Type: EmailLocalPart · required

Name of the group, typically an email address local part.

Type: Id<Domain> · required

Identifier for the domain this group belongs to. This is used to determine the email address of the group, which is formed as name@domain.

Type: EmailAddress · server-set

Email address of the group, formed as name@domain.

Type: String?

Description of the group

Type: UTCDateTime · server-set

Creation date of the account

Type: Id<Tenant>?

Identifier for the tenant this group belongs to

Type: Roles · required

Roles assigned to this group

Type: Map<StorageQuota, UnsignedInt>

Quotas for different object types within this group

Type: Size · server-set

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

Type: Permissions · required

Permissions assigned to this group

Type: EmailAlias[]

List of email aliases for the group

Type: Locale · default: "en_US"

Preferred locale for the group

Type: TimeZone?

Preferred time zone for the account

The Account 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 sysAccountGet permission.

Terminal window
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"
]
}'

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 sysAccountCreate permission.

Terminal window
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"
]
}'

This operation requires the sysAccountUpdate permission.

Terminal window
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"
]
}'

This operation requires the sysAccountDestroy permission.

Terminal window
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"
]
}'

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

This method requires the sysAccountQuery permission.

Terminal window
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):

ConditionKind
texttext
nametext
domainIdid of Domain
memberTenantIdid of Tenant
memberGroupIdsid of Account/Group

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

Terminal window
stalwart-cli get Account id1
Terminal window
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"}'
Terminal window
stalwart-cli query Account
Terminal window
stalwart-cli update Account id1 --field description='updated value'
Terminal window
stalwart-cli delete Account --ids id1

Defines an authentication credential for an account.

  • Password: Password for authenticating to the account. Carries the fields of PasswordCredential.
  • AppPassword: App password for third-party applications. Carries the fields of SecondaryCredential.
  • ApiKey: API key for programmatic access. Carries the fields of SecondaryCredential.

Password-based authentication credential.

Type: String · required · secret

Secret value of the account

Type: Uri? · secret

OTP authentication URI for the account

Type: UTCDateTime?

Expiration date of the credential

Type: IpMask[]

List of allowed IP addresses or CIDR ranges for this credential

App password or API key credential for programmatic access.

Type: String · required

Description of the credential

Type: String · read-only · server-set · secret

Secret value of the credential

Type: UTCDateTime · read-only · server-set

Creation date of the credential

Type: UTCDateTime?

Expiration date of the credential

Type: CredentialPermissions · required

List of permissions assigned to this credential

Type: IpMask[]

List of allowed IP addresses or CIDR ranges for this credential

Permission assignment mode for a credential.

List of permissions to assign to a credential.

Type: Permission[]

List of permissions to assign.

Role assignment for user accounts.

  • User: User role. No additional fields.
  • Admin: Administrator 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.

Defines an email alias for an account or mailing list.

Type: Boolean · default: true

Whether this email alias is enabled

Type: EmailLocalPart · required

The local part of the email alias (the part before the @ symbol)

Type: Id<Domain> · required

Identifier for the domain of the email alias (the part after the @ symbol).

Type: String?

Description of the email alias

Encryption-at-rest algorithm selection.

Encryption-at-rest settings for an account.

Type: Id<PublicKey> · required

Public key used for encrypting emails

Type: Boolean · default: false

Whether to encrypt emails when they are appended to mailboxes

Type: Boolean · default: false

Whether 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 of CustomRoles.
ValueLabel
maxEmailsMaximum number of emails
maxMailboxesMaximum number of mailboxes
maxEmailSubmissionsMaximum number of email submissions
maxEmailIdentitiesMaximum number of email identities
maxParticipantIdentitiesMaximum number of participant identities
maxSieveScriptsMaximum number of Sieve scripts
maxPushSubscriptionsMaximum number of push subscriptions
maxCalendarsMaximum number of calendars
maxCalendarEventsMaximum number of calendar events
maxCalendarEventNotificationsMaximum number of calendar event notifications
maxAddressBooksMaximum number of address books
maxContactCardsMaximum number of contact cards
maxFilesMaximum number of files
maxFoldersMaximum number of folders
maxMaskedAddressesMaximum number of masked email addresses
maxAppPasswordsMaximum number of app passwords
maxApiKeysMaximum number of API keys
maxPublicKeysMaximum number of public keys
maxDiskQuotaMaximum disk space allocated (bytes)