update_calendar_event uses for attendees, and for the same reason: a full-replacement object forces a caller to read the whole record first and silently drops anything it did not know to re-send. Here that would mean an agent correcting a postal code wiping a phone number a CardDAV client added an hour earlier.
Find the contact_id and the [a0]-style handles with search_contacts — the id appears in both response formats, the handles in detailed.
Parameters
New birthday as
YYYY-MM-DD, or --MM-DD when the year is unknown; "" clears it. Omit to keep the stored one. Only the birthday is touched: a wedding or other anniversary a CardDAV client stored on the same card is preserved, and a birthday another client wrote is edited in place rather than duplicated.New note, replacing every note stored on the contact;
"" clears them. Omit to keep them. (A contact edited in a CardDAV client can carry more than one note — search_contacts shows them joined, and this field replaces the whole thing rather than writing beside them.)Roles to add: what the person is to the user, such as
lawyer. Up to 10 per contact, stored lowercase with a leading “my” dropped; one the contact already holds is skipped (asked alone, the call reports that nothing changed). Record only a role the user said or confirmed (“Robin is my lawyer”), never one inferred from mail. search_contacts then finds the person by it and ranks them first. A job title another client stored on the card is left alone.Email addresses to add, each
{ address, context? }. Re-adding an address already on the card is a no-op; an address that belongs to a different contact is rejected, the same way create_contact rejects it.The address mail to this contact should go to: one already on the contact, or one added in the same call. It is stored on the contact (vCard
PREF), and search_contacts ranks it first, ahead of the confidence ratings. Naming an address the contact does not hold is refused and changes nothing.Postal addresses to add — same components as
create_contact.Corrections to stored postal addresses: each entry names a
key (the [a0] handle) plus only the components that change. Everything left out keeps its stored value — including parts of an imported address this API has no field for, such as a separately stored house number, apartment, or floor. Correcting street replaces the whole street line, which is what search_contacts showed you.Postal addresses to remove, each given either as its
[a0] handle or as its label (home, work).contactId is required.
Example — correcting one component
Call
Result
Errors
No contact with id <id>.— the id does not resolve. Find it withsearch_contacts.<address> already belongs to a different contact (contact_id: …)— remove it there first, or edit that record instead. If both records are the same person or organization, fold them into one withmerge_contacts.<address> is not an address of this contact.—preferredEmailnames an address the contact does not hold. Add it withaddedEmailsin the same call.This contact has no postal address <key>. Stored handles: …— a correction was addressed to a handle the card does not carry. Nothing is written; read the handles back withsearch_contactsindetailedformat.update_contact needs at least one field to change.— onlycontactIdwas passed.Birthday "<value>" is not a date./… is not a calendar date— passYYYY-MM-DDor--MM-DD, with a day the month actually has. Nothing was changed.
What this tool does not do
It does not merge two contacts — that ismerge_contacts — and it does not change a record’s source. A derived record you correct stays derived — the correction is protected regardless, because collection only ever fills blanks and never overwrites a field that already has a value.