Update contact
update_contactUpdate a contact's full record in MailFathom, setting name, addresses, preferred address, and note. Read the existing record first to avoid overwriting needed data.
Instructions
Amends one person in MailFathom's own contact book. State the whole record you want them to have — the name, every address, which one is preferred, and the note — rather than only what changes: an address the new record does not name is removed, and an omitted note clears the one held. Read the contact with get_contact first so nothing is dropped by accident. Writes to local state only, and touches no mail. A contact this deployment collected from arriving mail answers contactWasCollected: only the operator can take such a record on, through mfctl, and it can then be amended.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | What the note is to say afterwards, up to 4000 characters. Omit or send empty to clear it; sending the note back unchanged is what keeps it. | |
| addresses | Yes | Every mail address the contact is to hold afterwards, at most 32 entries, two spellings of one address counting as two entries and stored as one. An address the record no longer names is removed and becomes free for another contact to claim; one another contact already holds refuses the write. | |
| contactId | Yes | The contactId of the person to amend, as a listing or an earlier write returned it. | |
| displayName | Yes | The name the contact is to carry, up to 256 characters. Characters that render as nothing are refused. | |
| preferredAddress | Yes | The address to use by default afterwards. Must be one of addresses. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes | How the write ended. written means the book holds the record; notFound means no contact of that identifier is in the book; addressHeldByAnotherContact means one of the addresses already belongs to somebody else, named by addressHolderContactId; contactWasCollected means the record came from mail that arrived rather than from somebody writing it down, so promote_contact it before amending it; alreadyAsserted means a promotion had nothing left to do. | |
| contact | No | The record as the book now holds it, or null. Only a write whose record you supplied publishes one: create_contact, update_contact, add_contact_address, and remove_contact_address answer with the record when they succeed, while promote_contact answers with the outcome alone and is read back with get_contact. | |
| addressHolderContactId | No | The identifier of one contact that already holds an address this write claimed, or null when that is not what stopped it. Read that contact with get_contact to see who it is; a record may clash with more than one person, and this names one of them. |