Task
Represents a background task scheduled for execution.
This object can be configured from the WebUI under Management › Tasks › Scheduled Management › Tasks › Failed
Fields
Section titled “Fields”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.
@type: "IndexDocument"
Section titled “@type: "IndexDocument"”Index document
documentType
Section titled “documentType”Type:
IndexDocumentType· read-onlyType of document associated with the task
accountId
Section titled “accountId”Type:
Id<Account>· read-onlyIdentifier of the account associated with this task
documentId
Section titled “documentId”Type:
Id· read-onlyIdentifier of the document associated with this task
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "UnindexDocument"
Section titled “@type: "UnindexDocument"”Unindex document
documentType
Section titled “documentType”Type:
IndexDocumentType· read-onlyType of document associated with the task
accountId
Section titled “accountId”Type:
Id<Account>· read-onlyIdentifier of the account associated with this task
documentId
Section titled “documentId”Type:
Id· read-onlyIdentifier of the document associated with this task
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "IndexTrace"
Section titled “@type: "IndexTrace"”Index telemetry trace
traceId
Section titled “traceId”Type:
Id<Trace>· read-onlyIdentifier of the trace associated with this task
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "CalendarAlarmEmail"
Section titled “@type: "CalendarAlarmEmail"”Calendar alarm e-mail
alarmId
Section titled “alarmId”Type:
UnsignedInt· server-set · default:0Identifier of the calendar alarm associated with this task
eventId
Section titled “eventId”Type:
UnsignedInt· server-set · default:0Identifier of the calendar event associated with this task
eventStart
Section titled “eventStart”Type:
UTCDateTime· server-setStart date and time of the calendar event
eventEnd
Section titled “eventEnd”Type:
UTCDateTime· server-setEnd date and time of the calendar event
eventStartTz
Section titled “eventStartTz”Type:
UnsignedInt· server-set · default:0Timezone identifier for the start date and time
eventEndTz
Section titled “eventEndTz”Type:
UnsignedInt· server-set · default:0Timezone identifier for the end date and time
accountId
Section titled “accountId”Type:
Id<Account>· read-onlyIdentifier of the account associated with this task
documentId
Section titled “documentId”Type:
Id· read-onlyIdentifier of the document associated with this task
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "CalendarAlarmNotification"
Section titled “@type: "CalendarAlarmNotification"”Calendar alarm notification
alarmId
Section titled “alarmId”Type:
UnsignedInt· server-set · default:0Identifier of the calendar alarm associated with this task
eventId
Section titled “eventId”Type:
UnsignedInt· server-set · default:0Identifier of the calendar event associated with this task
recurrenceId
Section titled “recurrenceId”Type:
Integer?· server-setRecurrence identifier for the alarm, if applicable
accountId
Section titled “accountId”Type:
Id<Account>· read-onlyIdentifier of the account associated with this task
documentId
Section titled “documentId”Type:
Id· read-onlyIdentifier of the document associated with this task
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "CalendarItipMessage"
Section titled “@type: "CalendarItipMessage"”Calendar iTIP message
messages
Section titled “messages”Type:
TaskCalendarItipContents[]· server-setList of iTIP messages associated with this task
accountId
Section titled “accountId”Type:
Id<Account>· read-onlyIdentifier of the account associated with this task
documentId
Section titled “documentId”Type:
Id· read-onlyIdentifier of the document associated with this task
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "MergeThreads"
Section titled “@type: "MergeThreads"”Merge email threads
accountId
Section titled “accountId”Type:
Id<Account>· server-setIdentifier of the account associated with this task
threadName
Section titled “threadName”Type:
String· server-setName of the thread to be merged
messageIds
Section titled “messageIds”Type:
String[]· server-setMessage-IDs of the email messages to be merged into the thread
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "DmarcReport"
Section titled “@type: "DmarcReport"”Send DMARC report to remote server
reportId
Section titled “reportId”Type:
Id<DmarcInternalReport>· server-setIdentifier for the DMARC aggregate report associated with this task
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "TlsReport"
Section titled “@type: "TlsReport"”Send TLS report to remote server
reportId
Section titled “reportId”Type:
Id<TlsInternalReport>· server-setIdentifier for the TLS aggregate report associated with this task
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "RestoreArchivedItem"
Section titled “@type: "RestoreArchivedItem"”Restore archived item
blobId
Section titled “blobId”Type:
BlobId· server-setIdentifier of the archived blob to be restored
archivedItemType
Section titled “archivedItemType”Type:
ArchivedItemType· server-setType of the archived item associated with the blob
createdAt
Section titled “createdAt”Type:
UTCDateTime· server-setTimestamp when the item was originally created
archivedUntil
Section titled “archivedUntil”Type:
UTCDateTime· server-setTimestamp until which the archived item will be deleted permanently if not restored
accountId
Section titled “accountId”Type:
Id<Account>· server-setIdentifier of the account to which the archived item belongs
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "DestroyAccount"
Section titled “@type: "DestroyAccount"”Destroy account and all associated data
accountId
Section titled “accountId”Type:
Id<Account>· server-setIdentifier of the account to be destroyed
accountName
Section titled “accountName”Type:
String· requiredName of the account to be destroyed
accountDomainId
Section titled “accountDomainId”Type:
Id<Domain>· requiredDomain identifier of the account to be destroyed, if applicable
accountType
Section titled “accountType”Type:
AccountType· server-setType of the deleted account (user or group)
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "AccountMaintenance"
Section titled “@type: "AccountMaintenance"”Perform account maintenance operations
accountId
Section titled “accountId”Type:
Id<Account>· read-onlyIdentifier of the account to be maintained
maintenanceType
Section titled “maintenanceType”Type:
TaskAccountMaintenanceType· read-onlyType of maintenance operation to perform on the account
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "TenantMaintenance"
Section titled “@type: "TenantMaintenance"”Perform tenant maintenance operations
tenantId
Section titled “tenantId”Type:
Id<Tenant>· read-onlyIdentifier of the tenant to be maintained
maintenanceType
Section titled “maintenanceType”Type:
TaskTenantMaintenanceType· read-onlyType of maintenance operation to perform on the tenant
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "StoreMaintenance"
Section titled “@type: "StoreMaintenance"”Perform store maintenance operations
maintenanceType
Section titled “maintenanceType”Type:
TaskStoreMaintenanceType· read-onlyType of maintenance operation to perform on the store
shardIndex
Section titled “shardIndex”Type:
UnsignedInt?Index of the shard to perform maintenance on, if applicable for the maintenance type
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "SpamFilterMaintenance"
Section titled “@type: "SpamFilterMaintenance"”Perform spam filter maintenance operations
maintenanceType
Section titled “maintenanceType”Type:
TaskSpamFilterMaintenanceType· read-onlyType of maintenance operation to perform on the spam filter
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "AcmeRenewal"
Section titled “@type: "AcmeRenewal"”Perform ACME certificate renewal for a domain
domainId
Section titled “domainId”Type:
Id<Domain>· read-onlyIdentifier of the domain associated with this task
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "DkimManagement"
Section titled “@type: "DkimManagement"”Perform DKIM key rotation for a domain
domainId
Section titled “domainId”Type:
Id<Domain>· read-onlyIdentifier of the domain associated with this task
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
@type: "DnsManagement"
Section titled “@type: "DnsManagement"”Perform DNS management for a domain
updateRecords
Section titled “updateRecords”Type:
DnsRecordType[]Which DNS records should be updated for the domain as part of this task
onSuccessRenewCertificate
Section titled “onSuccessRenewCertificate”Type:
Boolean· default:falseWhether to automatically renew the domain’s TLS certificate using ACME after successfully updating DNS records
domainId
Section titled “domainId”Type:
Id<Domain>· read-onlyIdentifier of the domain associated with this task
status
Section titled “status”Type:
TaskStatus· requiredCurrent status of the task
Type:
UTCDateTime?· server-setDue date and time for the task
JMAP API
Section titled “JMAP API”The Task object is available via the urn:stalwart:jmap capability.
x:Task/get
Section titled “x:Task/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysTaskGet permission.
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" ] }'x:Task/set
Section titled “x:Task/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 sysTaskCreate permission.
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" ] }'Update
Section titled “Update”This operation requires the sysTaskUpdate permission.
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" ] }'Destroy
Section titled “Destroy”This operation requires the sysTaskDestroy permission.
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" ] }'x:Task/query
Section titled “x:Task/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysTaskQuery permission.
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):
| Condition | Kind |
|---|---|
@type | enum: TaskType |
status | enum: TaskStatusType |
due | date |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get Task id1Create
Section titled “Create”stalwart-cli create Task/IndexDocument \ --field 'status={"@type":"Pending","due":"2026-01-01T00:00:00Z"}'stalwart-cli query Taskstalwart-cli query Task --where @type=valueUpdate
Section titled “Update”stalwart-cli update Task id1 --field status='{"@type":"Pending","due":"2026-01-01T00:00:00Z"}'Delete
Section titled “Delete”stalwart-cli delete Task --ids id1Nested types
Section titled “Nested types”TaskStatus
Section titled “TaskStatus”Execution status of a background task.
Pending: Pending task awaiting execution. Carries the fields ofTaskStatusPending.Retry: Task scheduled for retry. Carries the fields ofTaskStatusRetry.Failed: Failed task. Carries the fields ofTaskStatusFailed.
TaskStatusPending
Section titled “TaskStatusPending”Pending task status details.
createdAt
Section titled “createdAt”Type:
UTCDateTime· server-setDate and time when the task was created
Type:
UTCDateTime· requiredDue date and time for the task
TaskStatusRetry
Section titled “TaskStatusRetry”Task retry status details.
createdAt
Section titled “createdAt”Type:
UTCDateTime· server-setDate and time when the task was created
Type:
UTCDateTime· requiredDue date and time for the task
attemptNumber
Section titled “attemptNumber”Type:
UnsignedInt· default:1Number of attempts made to complete the task
failureReason
Section titled “failureReason”Type:
Text· requiredReason for the last failure
TaskStatusFailed
Section titled “TaskStatusFailed”Failed task status details.
createdAt
Section titled “createdAt”Type:
UTCDateTime· server-setDate and time when the task was created
failedAt
Section titled “failedAt”Type:
UTCDateTime· requiredDate and time when the task failed
failedAttemptNumber
Section titled “failedAttemptNumber”Type:
UnsignedInt· default:0Number of attempts made before the task failed
failureReason
Section titled “failureReason”Type:
Text· requiredReason for task failure
TaskCalendarItipContents
Section titled “TaskCalendarItipContents”Contents of an iTIP message to be delivered.
Type:
EmailAddress· server-setEmail address of the sender of the iTIP message
Type:
EmailAddress[]· server-setEmail addresses of the recipients of the iTIP message
isFromOrganizer
Section titled “isFromOrganizer”Type:
Boolean· server-set · default:falseIndicates whether the sender is the organizer of the calendar event
iCalendarData
Section titled “iCalendarData”Type:
String· server-setiCalendar data associated with the iTIP message
summary
Section titled “summary”Type:
String· server-setSummary of the calendar event associated with the iTIP message
IndexDocumentType
Section titled “IndexDocumentType”| Value | Label |
|---|---|
email | |
calendar | Calendar |
contacts | Contacts |
file | File |
ArchivedItemType
Section titled “ArchivedItemType”| Value | Label |
|---|---|
Email | Archived Email message |
FileNode | Archived File |
CalendarEvent | Archived Calendar Event |
ContactCard | Archived Contact Card |
SieveScript | Archived Sieve Script |
AccountType
Section titled “AccountType”| Value | Label |
|---|---|
User | User account |
Group | Group account |
TaskAccountMaintenanceType
Section titled “TaskAccountMaintenanceType”| Value | Label |
|---|---|
purge | Purge expired data from the account |
reindex | Reindex the account’s data for search |
recalculateImapUid | Recalculate IMAP UIDs for the account’s email messages |
recalculateQuota | Recalculate storage quota usage for the account |
TaskTenantMaintenanceType
Section titled “TaskTenantMaintenanceType”| Value | Label |
|---|---|
recalculateQuota | Recalculate storage quota usage for the tenant |
TaskStoreMaintenanceType
Section titled “TaskStoreMaintenanceType”| Value | Label |
|---|---|
reindexAccounts | Reindex all accounts’ data for search |
reindexTelemetry | Reindex all telemetry data for search |
purgeAccounts | Purge expired data from all accounts |
purgeData | Purge data store |
purgeBlob | Purge blob store |
resetRateLimiters | Reset all rate limiters |
resetUserQuotas | Reset all user quotas |
resetTenantQuotas | Reset all tenant quotas |
resetBlobQuotas | Reset all blob quotas |
removeAuthTokens | Delete all temporary ACME and OAuth tokens |
removeLockQueueMessage | Delete all MTA queue message locks |
removeLockTask | Delete all task manager locks |
removeLockDav | Delete all DAV locks |
removeSieveId | Delete all Sieve vacation and duplicate ID lists |
removeGreylist | Delete all spam filter grey list entries |
TaskSpamFilterMaintenanceType
Section titled “TaskSpamFilterMaintenanceType”| Value | Label |
|---|---|
train | Train the spam classifier with the latest samples |
retrain | Retrain the spam classifier with all available samples |
abort | Abort the ongoing training process of the spam classifier |
reset | Delete the spam classifier’s model and reset it to the default state |
updateRules | Download and update the spam filter rules from the configured source |
DnsRecordType
Section titled “DnsRecordType”| Value | Label |
|---|---|
dkim | DKIM public keys |
tlsa | TLSA records |
spf | SPF records |
mx | MX records |
dmarc | DMARC policy |
srv | SRV records |
mtaSts | MTA-STS policy record |
tlsRpt | TLS reporting record |
caa | CAA records |
autoConfig | Autoconfig records |
autoConfigLegacy | Legacy Autoconfig records |
autoDiscover | Microsoft Autodiscover records |