Service: zimbraMail

Command: ModifyContact
Namespace: urn:zimbraMail
Description: Modify Contact
When modifying tags, all specified tags are set and all others are unset. If tn="{tag-names}" is NOT specified then any existing tags will remain set.
Properties:
Authorization token required true
Admin Authorization token required false

ModifyContactRequest

    <ModifyContactRequest [replace="{replace-mode} (0|1)"] [verbose="{verbose} (0|1)"]
                             [wantImapUid="{want-imap-uid} (0|1)"] [wantModSeq="{want-modified-sequence} (0|1)"]> ## ModifyContactRequest
        <cn [id="{id} (Integer)"] [tn="{tag-names}"]> ## ModifyContactSpec
            (<a [op="..."] n="{attr-name}" [aid="{upload-id}"] [id="{item-id} (Integer)"] [part="{subpart-name}"] /> ## ModifyContactAttr)*
            (<m [op="{member-operation} (+ | - | reset)"] type="{member-type}" value="{member-value}" /> ## ModifyContactGroupMember)*
        </cn>
    </ModifyContactRequest>

elements and attributes you can define within a <ModifyContactRequest> element:

XPath Required / Optional Description
@replace Optional (0 or 1) Type: 0|1
If set, all attrs and group members in the specified contact are replaced with specified attrs and group members, otherwise the attrs and group members are merged with the existing contact. Unset by default.
@verbose Optional (0 or 1) Type: 0|1
If unset, the returned <cn> is just a placeholder containing the contact ID (i.e. <cn id="{id}"/>). {verbose} is set by default.
@wantImapUid Optional (0 or 1) Type: 0|1
Set to return IMAP UID. (default is unset.)
@wantModSeq Optional (0 or 1) Type: 0|1
Set to return Modified Sequence. (default is unset.)
/cn Required (only 1) Specification of contact modifications
/cn@id Optional (0 or 1) Type: Integer
ID - specified when modifying a contact
/cn@tn Optional (0 or 1) Type: String
Comma-separated list of tag names
/cn/a Optional (0 or more) Contact attributes. Cannot specify <vcard> as well as these
/cn/a@op Optional (0 or 1) Type: String
/cn/a@n Required (only 1) Type: String
Attribute name
/cn/a@aid Optional (0 or 1) Type: String
Upload ID
/cn/a@id Optional (0 or 1) Type: Integer
Item ID. Used in combination with subpart-name
/cn/a@part Optional (0 or 1) Type: String
Subpart Name
/cn/m Optional (0 or more) Contact group members. Valid only if the contact being created is a contact group (has attribute type="group")
/cn/m@op Optional (0 or 1) Type: + | - | reset
Operation - +|-|reset
Required when replace-mode is unset, otherwise, it must not be set - INVALID_REQUEST will be thrown
+ add the member - {member-type} and {member-value} required
- remove the member - {member-type} and {member-value} required
reset delete all pre-existing members
/cn/m@type Required (only 1) Type: String
Member type
C reference to another contact
G reference to a GAL entry
I inlined member (member name and email address is embeded in the contact group)
/cn/m@value Required (only 1) Type: String
Member value
type="C" Item ID of another contact. If the referenced contact is in a shared folder, the item ID must be qualified by zimbraId of the owner. e.g. {zimbraId}:{itemId}
type="G" GAL entry reference (returned in SearchGalResponse)
type="I" name and email address in the form of: "{name}" <{email}>

ModifyContactResponse

    <ModifyContactResponse> ## ModifyContactResponse
        <cn [sf="{contact-sort-field}"] [exp="{can-expand} (0|1)"] id="{contact-id}" [i4uid="{imap-uid} (Integer)"]
                [l="{contact-folder-id}"] [f="{contact-flags}"] [t="{contact-tags}"] [tn="{contact-tag-names}"]
                [md="{contact-modified-date-secs} (Long)"] [ms="{contact-modified-seq} (Integer)"]
                [d="{contact-date-millis} (Long)"] [rev="{saved-sequence-number} (Integer)"] [fileAsStr="{contact-file-as}"]
                [email="{contact-email}"] [email2="{contact-email2}"] [email3="{contact-email3}"] [type="{contact-type}"]
                [dlist="{contact-dlist}"] [ref="{contact-gal-entry-ref}"]
                [tooManyMembers="{contact-too-many-members} (0|1)"]> ## ContactInfo
            (<meta [section="{section}"]> ## MailCustomMetadata
                (<a n="{key}">{value}</a> ## KeyValuePair)*
              </meta>)*
            (<a [part="{contact-part-id}"] [ct="{contact-content-type}"] [s="{contact-size} (Integer)"]
                    [filename="{contact-content-filename}"] n="{key}" /> ## ContactAttr)*
            (<m type="{member-type}" value="{member-value}"> ## ContactGroupMember
                <cn> ... </cn> ## See /cn [ ## ContactInfo] # [inside itself]
              </m>)*
            <memberOf>{memberOf} (String)</memberOf>
         </cn>
    </ModifyContactResponse>

elements and attributes you can define within a <ModifyContactResponse> element:

XPath Required / Optional Description
/cn Optional (0 or 1) Information about modified contact
/cn@sf Optional (0 or 1) Type: String
Sort field value
/cn@exp Optional (0 or 1) Type: 0|1
Set if the user can (has right to) expand group members. Returned only if needExp is set in the request and only on group entries (type=group in attrs on a <cn>).
/cn@id Required (only 1) Type: String
Unique contact ID
/cn@i4uid Optional (0 or 1) Type: Integer
IMAP UID
/cn@l Optional (0 or 1) Type: String
Folder ID. When creating a contact, this is the ID of the folder to create the contact in
/cn@f Optional (0 or 1) Type: String
Flags. {flags} = (f)lagged, has (a)ttachment
/cn@t Optional (0 or 1) Type: String
Tags - Comma separated list of integers. DEPRECATED - use "tn" instead
/cn@tn Optional (0 or 1) Type: String
Comma-separated list of tag names
/cn@md Optional (0 or 1) Type: Long
Modified date in seconds
/cn@ms Optional (0 or 1) Type: Integer
Modified sequence
/cn@d Optional (0 or 1) Type: Long
Date in milliseconds
/cn@rev Optional (0 or 1) Type: Integer
Saved sequence number
/cn@fileAsStr Optional (0 or 1) Type: String
Current "file as" string for display/sorting purposes; cannot be used to set the file-as value
/cn@email Optional (0 or 1) Type: String
Contact email address
/cn@email2 Optional (0 or 1) Type: String
Contact email address 2
/cn@email3 Optional (0 or 1) Type: String
Contact email address 3
/cn@type Optional (0 or 1) Type: String
Contact type
/cn@dlist Optional (0 or 1) Type: String
Contact dlist
/cn@ref Optional (0 or 1) Type: String
GAL entry reference
/cn@tooManyMembers Optional (0 or 1) Type: 0|1
If number of members on a GAL group is greater than the specified max, do not return any members for the entry. Instead, set "tooManyMembers.
/cn/meta Optional (0 or more) Custom metadata information
/cn/meta@section Optional (0 or 1) Type: String
Section.
Normally present. If absent this indicates that CustomMetadata info is present but there are no sections to report on.
/cn/meta/a Optional (0 or more) Type: {value}
Key value pairs
Description for element text content:Value
/cn/meta/a@n Required (only 1) Type: String
Key
/cn/a Optional (0 or more) Attributes
/cn/a@part Optional (0 or 1) Type: String
Part ID.
Can only specify a {contact-part-id} when modifying an existent contact
/cn/a@ct Optional (0 or 1) Type: String
Content type
/cn/a@s Optional (0 or 1) Type: Integer
Size
/cn/a@filename Optional (0 or 1) Type: String
Content filename
/cn/a@n Required (only 1) Type: String
Key
/cn/m Optional (0 or more) Contact group members
/cn/m@type Required (only 1) Type: String
Member type
C reference to another contact
G reference to a GAL entry
I inlined member (member name and email address is embeded in the contact group)
/cn/m@value Required (only 1) Type: String
Member value
type="C" Item ID of another contact. If the referenced contact is in a shared folder, the item ID must be qualified by zimbraId of the owner. e.g. {zimbraId}:{itemId}
type="G" GAL entry reference (returned in SearchGalResponse)
type="I" name and email address in the form of: "{name}" <{email}>
/cn/m/cn Optional (0 or 1) Contact information for dereferenced member.
See /cn for more details.
/cn/memberOf Optional (0 or 1) Type: {memberOf} (String)
Comma separated list of IDs of contact groups this contact is a member of.
Only provided if requested