Skip to content

ArchivedItem

Represents an archived item that can be restored.

This object can be configured from the WebUI under Account › Archived Items

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

Archived Email message

Type: String · required

Sender of the archived email message

Type: String · required

Subject of the archived email message

Type: UTCDateTime · required

Received date of the archived email message

Type: Size · read-only · default: 0

Size of the archived email message

Type: Id<Account> · required

The account to which the archived item belongs

Type: UTCDateTime · required

Timestamp when the item was archived

Type: UTCDateTime · required

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

Type: BlobId · required

Identifier of the archived blob

Type: ArchivedItemStatus · required

Current status of the archived item

Archived File

Type: String · required

Name of the archived file

Type: UTCDateTime · server-set

Creation date of the archived file

Type: Id<Account> · required

The account to which the archived item belongs

Type: UTCDateTime · required

Timestamp when the item was archived

Type: UTCDateTime · required

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

Type: BlobId · required

Identifier of the archived blob

Type: ArchivedItemStatus · required

Current status of the archived item

Archived Calendar Event

Type: String · required

Title of the archived calendar event

Type: UTCDateTime?

Start time of the archived calendar event

Type: UTCDateTime · server-set

Creation date of the archived calendar event

Type: Id<Account> · required

The account to which the archived item belongs

Type: UTCDateTime · required

Timestamp when the item was archived

Type: UTCDateTime · required

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

Type: BlobId · required

Identifier of the archived blob

Type: ArchivedItemStatus · required

Current status of the archived item

Archived Contact Card

Type: String?

Full name of the archived contact card

Type: UTCDateTime · server-set

Creation date of the archived contact card

Type: Id<Account> · required

The account to which the archived item belongs

Type: UTCDateTime · required

Timestamp when the item was archived

Type: UTCDateTime · required

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

Type: BlobId · required

Identifier of the archived blob

Type: ArchivedItemStatus · required

Current status of the archived item

Archived Sieve Script

Type: String · required

Name of the archived sieve script

Type: UTCDateTime · server-set

Creation date of the archived sieve script

Type: String · required

Content of the archived sieve script

Type: Id<Account> · required

The account to which the archived item belongs

Type: UTCDateTime · required

Timestamp when the item was archived

Type: UTCDateTime · required

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

Type: BlobId · required

Identifier of the archived blob

Type: ArchivedItemStatus · required

Current status of the archived item

The ArchivedItem 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 sysArchivedItemGet permission.

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

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:ArchivedItem/set",
{
"create": {
"new1": {
"@type": "Email",
"accountId": "<Account id>",
"archivedAt": "2026-01-01T00:00:00Z",
"archivedUntil": "2026-01-01T00:00:00Z",
"blobId": "abc123",
"from": "Example",
"receivedAt": "2026-01-01T00:00:00Z",
"subject": "Example"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysArchivedItemUpdate permission.

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

This operation requires the sysArchivedItemDestroy permission.

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

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

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

ConditionKind
accountIdid of Account

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

Terminal window
stalwart-cli get ArchivedItem id1
Terminal window
stalwart-cli create ArchivedItem/Email \
--field from=Example \
--field subject=Example \
--field receivedAt=2026-01-01T00:00:00Z \
--field 'accountId=<Account id>' \
--field archivedAt=2026-01-01T00:00:00Z \
--field archivedUntil=2026-01-01T00:00:00Z \
--field blobId=abc123
Terminal window
stalwart-cli query ArchivedItem
stalwart-cli query ArchivedItem --where accountId=id1
Terminal window
stalwart-cli update ArchivedItem id1 --field from='updated value'
Terminal window
stalwart-cli delete ArchivedItem --ids id1
ValueLabel
archivedItem is archived and available for restoration
requestRestoreRequest item restoration