ArchivedItem
ArchivedItem
Section titled “ArchivedItem”Represents an archived item that can be restored.
This object can be configured from the WebUI under Account › Archived Items
Fields
Section titled “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"
Section titled “@type: "Email"”Archived Email message
Type:
String· requiredSender of the archived email message
subject
Section titled “subject”Type:
String· requiredSubject of the archived email message
receivedAt
Section titled “receivedAt”Type:
UTCDateTime· requiredReceived date of the archived email message
Type:
Size· read-only · default:0Size of the archived email message
accountId
Section titled “accountId”Type:
Id<Account>· requiredThe account to which the archived item belongs
archivedAt
Section titled “archivedAt”Type:
UTCDateTime· requiredTimestamp when the item was archived
archivedUntil
Section titled “archivedUntil”Type:
UTCDateTime· requiredTimestamp until which the archived item will be deleted permanently if not restored
blobId
Section titled “blobId”Type:
BlobId· requiredIdentifier of the archived blob
status
Section titled “status”Type:
ArchivedItemStatus· requiredCurrent status of the archived item
@type: "FileNode"
Section titled “@type: "FileNode"”Archived File
Type:
String· requiredName of the archived file
createdAt
Section titled “createdAt”Type:
UTCDateTime· server-setCreation date of the archived file
accountId
Section titled “accountId”Type:
Id<Account>· requiredThe account to which the archived item belongs
archivedAt
Section titled “archivedAt”Type:
UTCDateTime· requiredTimestamp when the item was archived
archivedUntil
Section titled “archivedUntil”Type:
UTCDateTime· requiredTimestamp until which the archived item will be deleted permanently if not restored
blobId
Section titled “blobId”Type:
BlobId· requiredIdentifier of the archived blob
status
Section titled “status”Type:
ArchivedItemStatus· requiredCurrent status of the archived item
@type: "CalendarEvent"
Section titled “@type: "CalendarEvent"”Archived Calendar Event
Type:
String· requiredTitle of the archived calendar event
startTime
Section titled “startTime”Type:
UTCDateTime?Start time of the archived calendar event
createdAt
Section titled “createdAt”Type:
UTCDateTime· server-setCreation date of the archived calendar event
accountId
Section titled “accountId”Type:
Id<Account>· requiredThe account to which the archived item belongs
archivedAt
Section titled “archivedAt”Type:
UTCDateTime· requiredTimestamp when the item was archived
archivedUntil
Section titled “archivedUntil”Type:
UTCDateTime· requiredTimestamp until which the archived item will be deleted permanently if not restored
blobId
Section titled “blobId”Type:
BlobId· requiredIdentifier of the archived blob
status
Section titled “status”Type:
ArchivedItemStatus· requiredCurrent status of the archived item
@type: "ContactCard"
Section titled “@type: "ContactCard"”Archived Contact Card
Type:
String?Full name of the archived contact card
createdAt
Section titled “createdAt”Type:
UTCDateTime· server-setCreation date of the archived contact card
accountId
Section titled “accountId”Type:
Id<Account>· requiredThe account to which the archived item belongs
archivedAt
Section titled “archivedAt”Type:
UTCDateTime· requiredTimestamp when the item was archived
archivedUntil
Section titled “archivedUntil”Type:
UTCDateTime· requiredTimestamp until which the archived item will be deleted permanently if not restored
blobId
Section titled “blobId”Type:
BlobId· requiredIdentifier of the archived blob
status
Section titled “status”Type:
ArchivedItemStatus· requiredCurrent status of the archived item
@type: "SieveScript"
Section titled “@type: "SieveScript"”Archived Sieve Script
Type:
String· requiredName of the archived sieve script
createdAt
Section titled “createdAt”Type:
UTCDateTime· server-setCreation date of the archived sieve script
content
Section titled “content”Type:
String· requiredContent of the archived sieve script
accountId
Section titled “accountId”Type:
Id<Account>· requiredThe account to which the archived item belongs
archivedAt
Section titled “archivedAt”Type:
UTCDateTime· requiredTimestamp when the item was archived
archivedUntil
Section titled “archivedUntil”Type:
UTCDateTime· requiredTimestamp until which the archived item will be deleted permanently if not restored
blobId
Section titled “blobId”Type:
BlobId· requiredIdentifier of the archived blob
status
Section titled “status”Type:
ArchivedItemStatus· requiredCurrent status of the archived item
JMAP API
Section titled “JMAP API”The ArchivedItem object is available via the urn:stalwart:jmap capability.
x:ArchivedItem/get
Section titled “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
Section titled “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
Section titled “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
Section titled “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": { "from": "updated value" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Destroy
Section titled “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
Section titled “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 |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get ArchivedItem id1Create
Section titled “Create”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=abc123stalwart-cli query ArchivedItemstalwart-cli query ArchivedItem --where accountId=id1Update
Section titled “Update”stalwart-cli update ArchivedItem id1 --field from='updated value'Delete
Section titled “Delete”stalwart-cli delete ArchivedItem --ids id1ArchivedItemStatus
Section titled “ArchivedItemStatus”| Value | Label |
|---|---|
archived | Item is archived and available for restoration |
requestRestore | Request item restoration |