ArchivedItem
Represents an archived item that can be restored.
This object is only available with an Enterprise license.
This object can be configured from the WebUI under Account › Archived Items
Fields
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.
@type: "Email"
Archived Email message
from
Type:
String· requiredSender of the archived email message
subject
Type:
String· requiredSubject of the archived email message
receivedAt
Type:
UTCDateTime· requiredReceived date of the archived email message
size
Type:
Size· read-only · default:0Size of the archived email message
accountId
Type:
Id<Account>· requiredThe account to which the archived item belongs
archivedAt
Type:
UTCDateTime· requiredTimestamp when the item was archived
archivedUntil
Type:
UTCDateTime· requiredTimestamp until which the archived item will be deleted permanently if not restored
blobId
Type:
BlobId· requiredIdentifier of the archived blob
status
Type:
ArchivedItemStatus· requiredCurrent status of the archived item
@type: "FileNode"
Archived File
name
Type:
String· requiredName of the archived file
createdAt
Type:
UTCDateTime· server-setCreation date of the archived file
accountId
Type:
Id<Account>· requiredThe account to which the archived item belongs
archivedAt
Type:
UTCDateTime· requiredTimestamp when the item was archived
archivedUntil
Type:
UTCDateTime· requiredTimestamp until which the archived item will be deleted permanently if not restored
blobId
Type:
BlobId· requiredIdentifier of the archived blob
status
Type:
ArchivedItemStatus· requiredCurrent status of the archived item
@type: "CalendarEvent"
Archived Calendar Event
title
Type:
String· requiredTitle of the archived calendar event
startTime
Type:
UTCDateTime?Start time of the archived calendar event
createdAt
Type:
UTCDateTime· server-setCreation date of the archived calendar event
accountId
Type:
Id<Account>· requiredThe account to which the archived item belongs
archivedAt
Type:
UTCDateTime· requiredTimestamp when the item was archived
archivedUntil
Type:
UTCDateTime· requiredTimestamp until which the archived item will be deleted permanently if not restored
blobId
Type:
BlobId· requiredIdentifier of the archived blob
status
Type:
ArchivedItemStatus· requiredCurrent status of the archived item
@type: "ContactCard"
Archived Contact Card
name
Type:
String?Full name of the archived contact card
createdAt
Type:
UTCDateTime· server-setCreation date of the archived contact card
accountId
Type:
Id<Account>· requiredThe account to which the archived item belongs
archivedAt
Type:
UTCDateTime· requiredTimestamp when the item was archived
archivedUntil
Type:
UTCDateTime· requiredTimestamp until which the archived item will be deleted permanently if not restored
blobId
Type:
BlobId· requiredIdentifier of the archived blob
status
Type:
ArchivedItemStatus· requiredCurrent status of the archived item
@type: "SieveScript"
Archived Sieve Script
name
Type:
String· requiredName of the archived sieve script
createdAt
Type:
UTCDateTime· server-setCreation date of the archived sieve script
content
Type:
String· requiredContent of the archived sieve script
accountId
Type:
Id<Account>· requiredThe account to which the archived item belongs
archivedAt
Type:
UTCDateTime· requiredTimestamp when the item was archived
archivedUntil
Type:
UTCDateTime· requiredTimestamp until which the archived item will be deleted permanently if not restored
blobId
Type:
BlobId· requiredIdentifier of the archived blob
status
Type:
ArchivedItemStatus· requiredCurrent status of the archived item
JMAP API
The ArchivedItem object is available via the urn:stalwart:jmap capability.
x:ArchivedItem/get
This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysArchivedItemGet permission.
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"
]
}'
x:ArchivedItem/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
This operation requires the sysArchivedItemCreate permission.
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"
]
}'
Update
This operation requires the sysArchivedItemUpdate permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:ArchivedItem/set",
{
"update": {
"id1": {
"id": "id1"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
Destroy
This operation requires the sysArchivedItemDestroy permission.
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"
]
}'
x:ArchivedItem/query
This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysArchivedItemQuery permission.
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):
| Condition | Kind |
|---|---|
accountId | id of Account |
CLI
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
Fetch
stalwart-cli get archived-item id1
Create
stalwart-cli create archived-item/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
Query
stalwart-cli query archived-item
stalwart-cli query archived-item --where accountId=id1
Update
stalwart-cli update archived-item id1 --field description='Updated'
Delete
stalwart-cli delete archived-item --ids id1
Enums
ArchivedItemStatus
| Value | Label |
|---|---|
archived | Item is archived and available for restoration |
requestRestore | Request item restoration |