Skip to content

Mailbox

Capability: urn:ietf:params:jmap:mail

Arguments

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account to fetch mailboxes from.
idsMailboxId[]NoIDs of specific mailboxes to fetch. Omit to fetch all mailboxes for the account.
propertiesstring[]NoMailbox properties to include in the response. Omit for all properties.

Response

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account the mailboxes belong to.
statestringYesThe current state of the Mailbox type. Pass to Mailbox/changes to detect future changes.
listMailbox[]YesThe list of Mailbox objects that were found.
notFoundstring[]NoIDs from the request that could not be found.

Capability: urn:ietf:params:jmap:mail

Arguments

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account to fetch mailbox changes for.
sinceStatestringYesThe state string from the last Mailbox/get or Mailbox/changes response.
maxChangesintegerNoMaximum number of change records to return. If exceeded, hasMoreChanges will be true.

Response

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account these mailbox changes belong to.
oldStatestringYesThe state this response starts from.
newStatestringYesThe current state after all listed changes; pass to the next call.
hasMoreChangesbooleanYesIf true, additional changes exist beyond maxChanges. Call again with newState.
createdMailboxId[]YesIDs of mailboxes created since sinceState.
updatedMailboxId[]YesIDs of mailboxes whose properties changed since sinceState.
destroyedMailboxId[]YesIDs of mailboxes destroyed since sinceState.
updatedPropertiesarray?NoIf only the totalEmails, unreadEmails, totalThreads and/or unreadThreads properties changed, the names of the Mailbox properties that may have changed; null if the server cannot tell that only counts changed.

Capability: urn:ietf:params:jmap:mail

Arguments

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account to apply changes to.
ifInStatestring?NoOptimistic concurrency guard. The call fails with stateMismatch if the Mailbox state differs.
createobject?NoMap of client-assigned creation ids to Mailbox objects to create.
updateobject?NoMap of MailboxId to PatchObject. Only explicitly listed properties are changed.
destroyarray?NoMailboxIds to delete.
onDestroyRemoveEmailsbooleanNoIf true, also destroy all emails in the mailbox. Default false; destroying a non-empty mailbox without this flag results in a mailboxHasChild or mailboxHasEmail error.

Response

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account the changes were applied to.
oldStatestring?NoThe Mailbox state before this set, or null if the server cannot calculate it.
newStatestringYesThe Mailbox state after this set.
createdobject?NoSuccessfully created mailboxes, keyed by client creation id.
updatedobject?NoMap of successfully updated MailboxId to the updated object (or null if unchanged properties are not returned).
destroyedanyNoMailboxIds that were successfully destroyed.
notCreatedobject?NoCreation ids that failed, with a SetError.
notUpdatedobject?NoMailboxIds that failed to update, with a SetError.
notDestroyedobject?NoMailboxIds that failed to destroy, with a SetError.

Capability: urn:ietf:params:jmap:mail

Arguments

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account to query mailboxes from.
filterobjectNoFilter conditions. Supported properties: parentId (MailboxId|null), name (String), role (String|null), hasAnyRole (Boolean), isSubscribed (Boolean).
sortarray?NoSort criteria. Each Comparator has a property (e.g. name, sortOrder) and optional isAscending (default true).
sortAsTreebooleanNoIf true, the results are sorted as a tree by parentId: a Mailbox that is an ancestor of another comes first, and siblings are sorted by the sort comparators (default false; RFC 8621 section 2.3).
filterAsTreebooleanNoIf true, a Mailbox is included only if all its ancestors are also included by the filter (default false; RFC 8621 section 2.3).
positionintegerNoZero-based index of the first id to return. A negative value is an offset from the end of the list (RFC 8620 section 5.5). Ignored when anchor is given.
anchorstring?NoAn id. When given, position is ignored and the first id returned is at the index of this id in the results plus anchorOffset, clamped to 0; an id that is not in the results is the error anchorNotFound (RFC 8620 section 5.5).
anchorOffsetintegerNoIndex of the first id to return relative to the index of the anchor; may be negative. Ignored without an anchor.
limitinteger?NoMaximum number of ids to return.
calculateTotalbooleanNoIf true, return the total number of matching mailboxes.

Response

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account the query ran against.
queryStatestringYesOpaque state string. Pass to Mailbox/queryChanges to detect future changes.
canCalculateChangesbooleanYesWhether Mailbox/queryChanges can be used with this query.
positionintegerYes0-based index of the first id in the ids array.
idsMailboxId[]YesThe matching MailboxIds in the requested order.
totalintegerNoTotal number of matching mailboxes. Only present if calculateTotal was true.
limitintegerNoThe limit applied. Only present if a limit was applied.

Capability: urn:ietf:params:jmap:mail

Arguments

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account to check for query changes.
filterobject?NoMust match the filter used in the original Mailbox/query call.
sortarray?NoMust match the sort used in the original Mailbox/query call.
sinceQueryStatestringYesThe queryState from the previous Mailbox/query or Mailbox/queryChanges response.
maxChangesinteger?NoMaximum number of changes to return. If exceeded, hasMoreChanges will be true.
upToIdstring?NoReturn changes only up to and including this MailboxId.
calculateTotalbooleanNoIf true, return the updated total count of results.

Response

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account these query changes belong to.
oldQueryStatestringYesThe queryState this response starts from (matches sinceQueryState from request).
newQueryStatestringYesThe current queryState. Pass to the next Mailbox/queryChanges call.
removedMailboxId[]YesMailboxIds that are no longer in the query result set.
addedobject[]YesMailboxes that are now in the result set, with their new positions.
totalintegerNoUpdated total count of results (if calculateTotal was true in the original query).
upToIdMailboxIdNoEchoes the upToId from the request, if provided.