Create, update or delete a contact
distru-mutate-company-contactWriteCreates, updates or deletes one contact (a person) at a customer or vendor company, or at your own.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| action | enumCREATEUPDATEDELETE | Yes | |
| id | string | No | Required for UPDATE and DELETE. Resolve via distru-search-contacts. |
| companyId | string | No | Required for CREATE; cannot change afterwards. A customer, a vendor or your own company. Resolve via distru-search-companies. |
| firstName | string | No | Required for CREATE. |
| lastName | string or null | No | Send null to clear it. |
| title | string or null | No | Send null to clear it. |
| description | string or null | No | Send null to clear it. |
| string or null | No | Send null to clear it. | |
| phone | string or null | No | Send null to clear it. |
| workPhone | string or null | No | Send null to clear it. |
| ownerId | string or null | No | Distru user responsible for the contact. Resolve via distru-search-users. Send null to clear it. |
| driverLicenseNumber | string or null | No | Send null to clear it. |
| driverLicenseIssuingState | string or null | No | Two-letter US state code, e.g. CA. Send null to clear it. |
| customFields | object[] | No | Only the fields listed change. Required custom fields must be set, on update too, while still blank. |
| customFields[]. | string | Yes | Resolve via distru-search-custom-fields (entityType CONTACT). |
| customFields[]. | string or string[] | Yes | TEXT: the text. DROPDOWN: the option name. CHECKBOX: an array of option names. DATE: YYYY-MM-DD, company timezone. "" or [] clears the field. |
Output
This tool returns one of 2 shapes, depending on its inputs.
Presence on a nested field assumes its parent exists.
Result with contact
| Field | Type | Presence | Description |
|---|---|---|---|
| contact | object | Always | |
| contact. | string | Always | |
| contact. | string | Always | |
| contact. | string | Null or absent | |
| contact. | string | Null or absent | |
| contact. | string | Null or absent | |
| contact. | string | Null or absent | |
| contact. | string | Null or absent | |
| contact. | string | Null or absent | |
| contact. | object | Null or absent | |
| contact. | string | Always | |
| contact. | string | Null or absent | |
| contact. | string | Null or absent | |
| contact. | string | Null or absent | |
| contact. | object[] | Always | |
| contact. | object | Always | |
| contact. | string | Always | |
| contact. | string | Always | |
| contact. | enumCHECKBOXDATEDROPDOWNTEXT | Always | |
| contact. | string | Can be null | Null when unset. DATE values are days (YYYY-MM-DD) in the company timezone; CHECKBOX values are the selected option names, separated by commas. |
Result with id
| Field | Type | Presence |
|---|---|---|
| id | string | Always |
What the AI reads
Creates, updates or deletes one contact (a person) at a customer or vendor company, or at your own. A contact, or company, hidden from you by team visibility is refused as permission denied. Some old contacts share a Distru user's profile; their name, title, description, email and phones can't be changed. Read current values with distru-get-company first (includeContacts). DELETE soft-deletes the contact. CREATE and UPDATE return the contact as distru-get-company does; DELETE returns its id. Sparse update: UPDATE changes only the fields sent; a field sent as null is cleared.