Skip to content

Task

Represents a background task scheduled for execution.

This object can be configured from the WebUI under Management › Tasks › Scheduled Management › Tasks › Failed

Task 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.

Index document

Type: IndexDocumentType · read-only

Type of document associated with the task

Type: Id<Account> · read-only

Identifier of the account associated with this task

Type: Id · read-only

Identifier of the document associated with this task

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Unindex document

Type: IndexDocumentType · read-only

Type of document associated with the task

Type: Id<Account> · read-only

Identifier of the account associated with this task

Type: Id · read-only

Identifier of the document associated with this task

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Index telemetry trace

Type: Id<Trace> · read-only

Identifier of the trace associated with this task

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Calendar alarm e-mail

Type: UnsignedInt · server-set · default: 0

Identifier of the calendar alarm associated with this task

Type: UnsignedInt · server-set · default: 0

Identifier of the calendar event associated with this task

Type: UTCDateTime · server-set

Start date and time of the calendar event

Type: UTCDateTime · server-set

End date and time of the calendar event

Type: UnsignedInt · server-set · default: 0

Timezone identifier for the start date and time

Type: UnsignedInt · server-set · default: 0

Timezone identifier for the end date and time

Type: Id<Account> · read-only

Identifier of the account associated with this task

Type: Id · read-only

Identifier of the document associated with this task

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Calendar alarm notification

Type: UnsignedInt · server-set · default: 0

Identifier of the calendar alarm associated with this task

Type: UnsignedInt · server-set · default: 0

Identifier of the calendar event associated with this task

Type: Integer? · server-set

Recurrence identifier for the alarm, if applicable

Type: Id<Account> · read-only

Identifier of the account associated with this task

Type: Id · read-only

Identifier of the document associated with this task

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Calendar iTIP message

Type: TaskCalendarItipContents[] · server-set

List of iTIP messages associated with this task

Type: Id<Account> · read-only

Identifier of the account associated with this task

Type: Id · read-only

Identifier of the document associated with this task

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Merge email threads

Type: Id<Account> · server-set

Identifier of the account associated with this task

Type: String · server-set

Name of the thread to be merged

Type: String[] · server-set

Message-IDs of the email messages to be merged into the thread

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Send DMARC report to remote server

Type: Id<DmarcInternalReport> · server-set

Identifier for the DMARC aggregate report associated with this task

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Send TLS report to remote server

Type: Id<TlsInternalReport> · server-set

Identifier for the TLS aggregate report associated with this task

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Restore archived item

Type: BlobId · server-set

Identifier of the archived blob to be restored

Type: ArchivedItemType · server-set

Type of the archived item associated with the blob

Type: UTCDateTime · server-set

Timestamp when the item was originally created

Type: UTCDateTime · server-set

Timestamp until which the archived item will be deleted permanently if not restored

Type: Id<Account> · server-set

Identifier of the account to which the archived item belongs

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Destroy account and all associated data

Type: Id<Account> · server-set

Identifier of the account to be destroyed

Type: String · required

Name of the account to be destroyed

Type: Id<Domain> · required

Domain identifier of the account to be destroyed, if applicable

Type: AccountType · server-set

Type of the deleted account (user or group)

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Perform account maintenance operations

Type: Id<Account> · read-only

Identifier of the account to be maintained

Type: TaskAccountMaintenanceType · read-only

Type of maintenance operation to perform on the account

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Perform tenant maintenance operations

Type: Id<Tenant> · read-only

Identifier of the tenant to be maintained

Type: TaskTenantMaintenanceType · read-only

Type of maintenance operation to perform on the tenant

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Perform store maintenance operations

Type: TaskStoreMaintenanceType · read-only

Type of maintenance operation to perform on the store

Type: UnsignedInt?

Index of the shard to perform maintenance on, if applicable for the maintenance type

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Perform spam filter maintenance operations

Type: TaskSpamFilterMaintenanceType · read-only

Type of maintenance operation to perform on the spam filter

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Perform ACME certificate renewal for a domain

Type: Id<Domain> · read-only

Identifier of the domain associated with this task

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Perform DKIM key rotation for a domain

Type: Id<Domain> · read-only

Identifier of the domain associated with this task

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

Perform DNS management for a domain

Type: DnsRecordType[]

Which DNS records should be updated for the domain as part of this task

Type: Boolean · default: false

Whether to automatically renew the domain’s TLS certificate using ACME after successfully updating DNS records

Type: Id<Domain> · read-only

Identifier of the domain associated with this task

Type: TaskStatus · required

Current status of the task

Type: UTCDateTime? · server-set

Due date and time for the task

The Task 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 sysTaskGet permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Task/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 sysTaskCreate permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Task/set",
{
"create": {
"new1": {
"@type": "IndexDocument",
"status": {
"@type": "Pending",
"due": "2026-01-01T00:00:00Z"
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysTaskUpdate permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Task/set",
{
"update": {
"id1": {
"status": {
"@type": "Pending",
"due": "2026-01-01T00:00:00Z"
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysTaskDestroy permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Task/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 sysTaskQuery permission.

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

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

ConditionKind
@typeenum: TaskType
statusenum: TaskStatusType
duedate

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

Terminal window
stalwart-cli get Task id1
Terminal window
stalwart-cli create Task/IndexDocument \
--field 'status={"@type":"Pending","due":"2026-01-01T00:00:00Z"}'
Terminal window
stalwart-cli query Task
stalwart-cli query Task --where @type=value
Terminal window
stalwart-cli update Task id1 --field status='{"@type":"Pending","due":"2026-01-01T00:00:00Z"}'
Terminal window
stalwart-cli delete Task --ids id1

Execution status of a background task.

Pending task status details.

Type: UTCDateTime · server-set

Date and time when the task was created

Type: UTCDateTime · required

Due date and time for the task

Task retry status details.

Type: UTCDateTime · server-set

Date and time when the task was created

Type: UTCDateTime · required

Due date and time for the task

Type: UnsignedInt · default: 1

Number of attempts made to complete the task

Type: Text · required

Reason for the last failure

Failed task status details.

Type: UTCDateTime · server-set

Date and time when the task was created

Type: UTCDateTime · required

Date and time when the task failed

Type: UnsignedInt · default: 0

Number of attempts made before the task failed

Type: Text · required

Reason for task failure

Contents of an iTIP message to be delivered.

Type: EmailAddress · server-set

Email address of the sender of the iTIP message

Type: EmailAddress[] · server-set

Email addresses of the recipients of the iTIP message

Type: Boolean · server-set · default: false

Indicates whether the sender is the organizer of the calendar event

Type: String · server-set

iCalendar data associated with the iTIP message

Type: String · server-set

Summary of the calendar event associated with the iTIP message

ValueLabel
emailEmail
calendarCalendar
contactsContacts
fileFile
ValueLabel
EmailArchived Email message
FileNodeArchived File
CalendarEventArchived Calendar Event
ContactCardArchived Contact Card
SieveScriptArchived Sieve Script
ValueLabel
UserUser account
GroupGroup account
ValueLabel
purgePurge expired data from the account
reindexReindex the account’s data for search
recalculateImapUidRecalculate IMAP UIDs for the account’s email messages
recalculateQuotaRecalculate storage quota usage for the account
ValueLabel
recalculateQuotaRecalculate storage quota usage for the tenant
ValueLabel
reindexAccountsReindex all accounts’ data for search
reindexTelemetryReindex all telemetry data for search
purgeAccountsPurge expired data from all accounts
purgeDataPurge data store
purgeBlobPurge blob store
resetRateLimitersReset all rate limiters
resetUserQuotasReset all user quotas
resetTenantQuotasReset all tenant quotas
resetBlobQuotasReset all blob quotas
removeAuthTokensDelete all temporary ACME and OAuth tokens
removeLockQueueMessageDelete all MTA queue message locks
removeLockTaskDelete all task manager locks
removeLockDavDelete all DAV locks
removeSieveIdDelete all Sieve vacation and duplicate ID lists
removeGreylistDelete all spam filter grey list entries
ValueLabel
trainTrain the spam classifier with the latest samples
retrainRetrain the spam classifier with all available samples
abortAbort the ongoing training process of the spam classifier
resetDelete the spam classifier’s model and reset it to the default state
updateRulesDownload and update the spam filter rules from the configured source
ValueLabel
dkimDKIM public keys
tlsaTLSA records
spfSPF records
mxMX records
dmarcDMARC policy
srvSRV records
mtaStsMTA-STS policy record
tlsRptTLS reporting record
caaCAA records
autoConfigAutoconfig records
autoConfigLegacyLegacy Autoconfig records
autoDiscoverMicrosoft Autodiscover records