ContactCard
ContactCard/get
Section titled “ContactCard/get”Capability: urn:ietf:params:jmap:contacts
Accepts result references: #ids from ContactCard/query (path /ids)
Arguments
| Property | Type | Required | Description |
|---|---|---|---|
accountId | AccountId | Yes | The account to fetch contact cards from. |
ids | any | No | IDs of specific contact cards to fetch. Null or omitted to fetch all contact cards. |
properties | any | No | ContactCard properties to include in the response. Null or omitted for all properties. |
Response
| Property | Type | Required | Description |
|---|---|---|---|
accountId | AccountId | Yes | The account the contact cards belong to. |
state | string | Yes | The current state of the ContactCard type. Pass to ContactCard/changes to detect future changes. |
list | ContactCard[] | Yes | The list of ContactCard objects that were found. |
notFound | string[] | Yes | IDs from the request that could not be found. |
ContactCard/set
Section titled “ContactCard/set”Capability: urn:ietf:params:jmap:contacts
Arguments
| Property | Type | Required | Description |
|---|---|---|---|
accountId | AccountId | Yes | The account to apply changes to. |
ifInState | string? | No | Optimistic concurrency guard. Fails with stateMismatch if the ContactCard state differs. |
create | object? | No | Map of client-assigned creation ids to ContactCardCreate objects. |
update | object? | No | Map of ContactCardId to PatchObject. Only explicitly listed properties are changed. |
destroy | array? | No | ContactCardIds to delete. |
Response
| Property | Type | Required | Description |
|---|---|---|---|
accountId | AccountId | Yes | The account the changes were applied to. |
oldState | string? | No | The ContactCard state before this set, or null if the server cannot calculate it. |
newState | string | Yes | The ContactCard state after this set. |
created | object? | No | Successfully created contact cards, keyed by client creation id. |
updated | object? | No | Map of successfully updated ContactCardId to the updated object (or null if unchanged properties are not returned). |
destroyed | any | No | ContactCardIds that were successfully destroyed. |
notCreated | object? | No | Creation ids that failed, with a SetError. |
notUpdated | object? | No | ContactCardIds that failed to update, with a SetError. |
notDestroyed | object? | No | ContactCardIds that failed to destroy, with a SetError. |
ContactCard/query
Section titled “ContactCard/query”Capability: urn:ietf:params:jmap:contacts
Provides result references: /ids
Arguments
| Property | Type | Required | Description |
|---|---|---|---|
accountId | AccountId | Yes | The account to query contact cards from. |
filter | object? | No | Filter conditions. Supported properties: inAddressBook (AddressBookId), uid (String), hasMember (String), kind (String), createdBefore/createdAfter (UTCDate), updatedBefore/updatedAfter (UTCDate), text/name/nickname/organization/email/phone/onlineService/address/note (String). |
sort | array? | No | Sort criteria. Each Comparator has a property (e.g. nickname, created, updated) and optional isAscending (default true). |
position | integer | No | 0-based index of the first result to return. |
anchor | ContactCardId | No | A ContactCardId to anchor the result page at. |
anchorOffset | integer | No | Offset from the anchor (may be negative). |
limit | integer | No | Maximum number of ids to return. |
calculateTotal | boolean | No | If true, return the total number of matching contact cards. |
Response
| Property | Type | Required | Description |
|---|---|---|---|
accountId | AccountId | Yes | The account the query ran against. |
queryState | string | Yes | Opaque state string. Pass to ContactCard/queryChanges to detect future changes. |
canCalculateChanges | boolean | Yes | Whether ContactCard/queryChanges can be used with this query. |
position | integer | Yes | 0-based index of the first id in the ids array. |
ids | ContactCardId[] | Yes | The matching ContactCardIds in the requested order. |
total | integer | No | Total number of matching contact cards. Only present if calculateTotal was true. |
limit | integer | No | The limit applied. Only present if a limit was applied. |
ContactCard/queryChanges
Section titled “ContactCard/queryChanges”Capability: urn:ietf:params:jmap:contacts
Arguments
| Property | Type | Required | Description |
|---|---|---|---|
accountId | AccountId | Yes | The account to check for query changes. |
filter | object? | No | Must match the filter used in the original ContactCard/query call. |
sort | array? | No | Must match the sort used in the original ContactCard/query call. |
sinceQueryState | string | Yes | The queryState from the previous ContactCard/query or ContactCard/queryChanges response. |
maxChanges | integer | No | Maximum number of changes to return. If exceeded, hasMoreChanges will be true. |
upToId | ContactCardId | No | Return changes only up to and including this ContactCardId. |
calculateTotal | boolean | No | If true, return the updated total count of results. |
Response
| Property | Type | Required | Description |
|---|---|---|---|
accountId | AccountId | Yes | The account these query changes belong to. |
oldQueryState | string | Yes | The queryState this response starts from (matches sinceQueryState from request). |
newQueryState | string | Yes | The current queryState. Pass to the next ContactCard/queryChanges call. |
hasMoreChanges | boolean | Yes | If true, more changes exist beyond maxChanges. Call again with newQueryState. |
removed | ContactCardId[] | Yes | ContactCardIds that are no longer in the query result set. |
added | object[] | Yes | Contact cards that are now in the result set, with their new positions. |
total | integer | No | Updated total count of results (if calculateTotal was true in the original query). |
ContactCard/changes
Section titled “ContactCard/changes”Capability: urn:ietf:params:jmap:contacts
Arguments
| Property | Type | Required | Description |
|---|---|---|---|
accountId | AccountId | Yes | The account to fetch contact card changes for. |
sinceState | string | Yes | The state string from the last ContactCard/get or ContactCard/changes response. |
maxChanges | integer | No | Maximum number of change records to return. If exceeded, hasMoreChanges will be true. |
Response
| Property | Type | Required | Description |
|---|---|---|---|
accountId | AccountId | Yes | The account these contact card changes belong to. |
oldState | string | Yes | The state this response starts from. |
newState | string | Yes | The current state after all listed changes; pass to the next call. |
hasMoreChanges | boolean | Yes | If true, additional changes exist beyond maxChanges. Call again with newState. |
created | ContactCardId[] | Yes | IDs of contact cards created since sinceState. |
updated | ContactCardId[] | Yes | IDs of contact cards whose properties changed since sinceState. |
destroyed | ContactCardId[] | Yes | IDs of contact cards destroyed since sinceState. |
ContactCard/copy
Section titled “ContactCard/copy”Capability: urn:ietf:params:jmap:contacts
Arguments
| Property | Type | Required | Description |
|---|---|---|---|
fromAccountId | AccountId | Yes | The account to copy contact cards from. |
ifFromInState | string? | No | Optimistic concurrency guard on the source ContactCard state. |
accountId | AccountId | Yes | The account to copy contact cards into. |
ifInState | string? | No | Optimistic concurrency guard on the destination ContactCard state. |
create | object | Yes | Map of client-assigned creation ids to objects describing the copy. |
onSuccessDestroyOriginal | boolean? | No | If true, destroy original contact cards on success. Default: false. |
destroyFromIfInState | string? | No | Guard on source state when destroying originals. |
Response
| Property | Type | Required | Description |
|---|---|---|---|
fromAccountId | AccountId | Yes | The source account. |
accountId | AccountId | Yes | The destination account. |
oldState | string? | No | The ContactCard state in the destination account before this operation. |
newState | string? | No | The ContactCard state in the destination account after this operation. |
created | object? | No | Successfully copied contact cards, keyed by client creation id. |
notCreated | object? | No | Creation ids that failed, with a SetError. |