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.
listMailboxExt[]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.

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).
positionintegerNo0-based index of the first result to return.
anchorMailboxIdNoA MailboxId to anchor the result page at.
anchorOffsetintegerNoOffset from the anchor (may be negative).
limitintegerNoMaximum 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.