Skip to content

Principal

Capability: urn:ietf:params:jmap:principals

Arguments

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account to fetch principals from.
idsanyNoIDs of specific principals to fetch. Null or omitted to fetch all principals.
propertiesanyNoPrincipal properties to include in the response. Null or omitted for all properties.

Response

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account the principals belong to.
statestringYesThe current state of the Principal type. Pass to Principal/changes to detect future changes.
listPrincipal[]YesThe list of Principal objects that were found.
notFoundstring[]YesIDs from the request that could not be found.

Capability: urn:ietf:params:jmap:principals

Arguments

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account to apply changes to.
ifInStatestring?NoOptimistic concurrency guard. Fails with stateMismatch if the Principal state differs.
createobject?NoAlways results in notCreated for server-managed principals.
updateobject?NoMap of PrincipalId to PatchObject. Only the calling user’s own principal may be updated.
destroyarray?NoAlways results in notDestroyed for server-managed principals.

Response

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account the changes were applied to.
oldStatestring?NoThe Principal state before this set, or null if the server cannot calculate it.
newStatestringYesThe Principal state after this set.
createdobject?NoSuccessfully created principals (typically empty — creation is server-managed).
updatedobject?NoMap of successfully updated PrincipalId to the updated object (or null if unchanged properties are not returned).
destroyedanyNoPrincipalIds that were successfully destroyed (typically empty — destruction is server-managed).
notCreatedobject?NoCreation ids that failed, with a SetError.
notUpdatedobject?NoPrincipalIds that failed to update, with a SetError.
notDestroyedobject?NoPrincipalIds that failed to destroy, with a SetError.

Capability: urn:ietf:params:jmap:principals

Arguments

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account to query principals from.
filterobject?NoFilter conditions. Supported properties: type (String), name (String), email (String), timeZone (String), description (String), hidden (Boolean).
sortarray?NoSort criteria. Each Comparator has a property (e.g. name, type) and optional isAscending (default true).
positionintegerNo0-based index of the first result to return.
anchorPrincipalIdNoA PrincipalId 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 principals.

Response

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

Capability: urn:ietf:params:jmap:principals

Arguments

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account to check for query changes.
filterobject?NoMust match the filter used in the original Principal/query call.
sortarray?NoMust match the sort used in the original Principal/query call.
sinceQueryStatestringYesThe queryState from the previous Principal/query or Principal/queryChanges response.
maxChangesintegerNoMaximum number of changes to return. If exceeded, hasMoreChanges will be true.
upToIdPrincipalIdNoReturn changes only up to and including this PrincipalId.
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 Principal/queryChanges call.
hasMoreChangesbooleanYesIf true, more changes exist beyond maxChanges. Call again with newQueryState.
removedPrincipalId[]YesPrincipalIds that are no longer in the query result set.
addedobject[]YesPrincipals that are now in the result set, with their new positions.
totalintegerNoUpdated total count of results (if calculateTotal was true in the original query).

Capability: urn:ietf:params:jmap:principals

Arguments

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

Response

PropertyTypeRequiredDescription
accountIdAccountIdYesThe account these principal 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.
createdPrincipalId[]YesIDs of principals created since sinceState.
updatedPrincipalId[]YesIDs of principals whose properties changed since sinceState.
destroyedPrincipalId[]YesIDs of principals destroyed since sinceState.