Update Client
Updates an existing client, identified by id in the request body. The endpoint supports two modes:
PATCH— partial merge (recommended for simple edits). Send only the fields you want to change plusid; everything else is left as-is.PUT— full replace. The record is overwritten with exactly what you send.
Authentication: X-API-KEY header (see Authentication).
Use PATCH for everyday edits — it's safer because you only send what changes. Use PUT when you deliberately want to replace the whole record. id is required for both, and accountId is always forced to your workspace, so a client can never be moved to another account.
PUT is a full replaceWith PUT, fields you omit are overwritten (cleared or reset to defaults). The safe pattern is: fetch the current record with List Clients or Search Clients, modify the fields you want to change (including customValues), then PUT the complete object back. If you only want to change a few fields, use PATCH instead.
Request body
The full Client object. Key fields:
| Field | Type | Description |
|---|---|---|
id | string | Required. Id of the client to update. |
name | string | Client / company name. |
clientType | enum | Client or Prospect. |
address1, address2, city, locality, postal, country | string | Address fields. |
website, phone | string | Contact details. |
taxId | string | Tax identifier. |
currency | string | Default currency code. |
defaultTaxRate | number | Default tax rate applied to this client. |
payInstructions | string | Payment instructions. |
notes | string | Free-text notes. |
customValues | CustomValue[] | Custom-field values (see below). |
Custom fields (customValues)
Each entry is a CustomValue:
| Field | Type | Description |
|---|---|---|
fieldId | string | Id of the custom field definition. |
mappingKey | string | Stable key used to match the field. |
fieldName | string | Human-readable field name. |
value | any | The value (string, number, boolean, etc.). |
type | enum | The custom field's data type. |
Request
curl -X PUT https://api.withmoxie.com/public/action/clients/update \
-H "X-API-KEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"id": "66b0f2a1c3a9e40012ab34cd",
"name": "Acme Kft.",
"clientType": "Client",
"address1": "Váci út 1.",
"city": "Budapest",
"postal": "1052",
"country": "HU",
"taxId": "12345678-2-41",
"currency": "HUF",
"defaultTaxRate": 27,
"customValues": [
{
"fieldId": "5f9c...",
"mappingKey": "account_manager",
"fieldName": "Account Manager",
"value": "Jane Doe",
"type": "TEXT"
}
]
}'
Response
Returns the updated Client object.
{
"id": "66b0f2a1c3a9e40012ab34cd",
"accountId": 10016,
"name": "Acme Kft.",
"clientType": "Client",
"address1": "Váci út 1.",
"city": "Budapest",
"postal": "1052",
"country": "HU",
"taxId": "12345678-2-41",
"currency": "HUF",
"defaultTaxRate": 27,
"customValues": [
{
"fieldId": "5f9c...",
"mappingKey": "account_manager",
"fieldName": "Account Manager",
"value": "Jane Doe",
"type": "TEXT"
}
]
}
Partial update (PATCH)
Send only the fields you want to change, plus id. Omitted fields keep their current values. To clear a field, send it explicitly as null.
curl -X PATCH https://api.withmoxie.com/public/action/clients/update \
-H "X-API-KEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"id": "66b0f2a1c3a9e40012ab34cd",
"defaultTaxRate": 27,
"currency": "HUF"
}'
Returns the full updated Client object (same shape as the PUT response above), with only defaultTaxRate and currency changed.
Errors
| Status | Meaning |
|---|---|
412 Precondition Failed | id was missing from the body. |
404 / Not Found | No client with that id exists in your workspace. |