Update Contact
Updates an existing contact, identified by id in the request body. Use PATCH to change a few fields (partial merge) or PUT to replace the whole record.
Authentication: X-API-KEY header (see Authentication).
PUT is a full replaceWith PUT, fields you omit are overwritten. Fetch the current contact with Search Contacts first, modify it, then PUT the complete object back. For a few fields, use PATCH instead. id is required for both; accountId is forced to your workspace.
Request body
The full Contact object. Key fields:
| Field | Type | Description |
|---|---|---|
id | string | Required. Id of the contact to update. |
clientId | string | Id of the client this contact belongs to. |
firstName, lastName | string | Contact name. |
role | string | Job title / role. |
email, phone, mobile | string | Contact details. |
notes | string | Free-text notes. |
defaultContact | boolean | Whether this is the client's default contact. |
invoiceContact | boolean | Include this contact on invoices. |
portalAccess | boolean | Grant client-portal access. |
customValues | CustomValue[] | Custom-field values (fieldId, mappingKey, fieldName, value, type). |
Request
curl -X PUT https://api.withmoxie.com/public/action/contacts/update \
-H "X-API-KEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"id": "66b0f3b2c3a9e40012ab5500",
"clientId": "66b0f2a1c3a9e40012ab34cd",
"firstName": "Jane",
"lastName": "Doe",
"role": "Billing",
"email": "jane@acme.example",
"phone": "+36 1 234 5678",
"invoiceContact": true,
"portalAccess": true
}'
Response
Returns the updated Contact object.
{
"id": "66b0f3b2c3a9e40012ab5500",
"accountId": 10016,
"clientId": "66b0f2a1c3a9e40012ab34cd",
"firstName": "Jane",
"lastName": "Doe",
"role": "Billing",
"email": "jane@acme.example",
"phone": "+36 1 234 5678",
"defaultContact": false,
"invoiceContact": true,
"portalAccess": true,
"customValues": []
}
Partial update (PATCH)
Send only the fields to change, plus id:
curl -X PATCH https://api.withmoxie.com/public/action/contacts/update \
-H "X-API-KEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"id": "66b0f3b2c3a9e40012ab5500",
"role": "Head of Finance",
"invoiceContact": true
}'
Returns the full updated Contact object with only role and invoiceContact changed.
Errors
| Status | Meaning |
|---|---|
412 Precondition Failed | id was missing from the body. |
404 / Not Found | No contact with that id exists in your workspace. |