Skip to main content

Update Client

PUT PATCH /public/action/clients/update

Updates an existing client, identified by id in the request body. The endpoint supports two modes:

  • PATCHpartial merge (recommended for simple edits). Send only the fields you want to change plus id; everything else is left as-is.
  • PUTfull replace. The record is overwritten with exactly what you send.

Authentication: X-API-KEY header (see Authentication).

Which method should I use?

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 replace

With 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:

FieldTypeDescription
idstringRequired. Id of the client to update.
namestringClient / company name.
clientTypeenumClient or Prospect.
address1, address2, city, locality, postal, countrystringAddress fields.
website, phonestringContact details.
taxIdstringTax identifier.
currencystringDefault currency code.
defaultTaxRatenumberDefault tax rate applied to this client.
payInstructionsstringPayment instructions.
notesstringFree-text notes.
customValuesCustomValue[]Custom-field values (see below).

Custom fields (customValues)

Each entry is a CustomValue:

FieldTypeDescription
fieldIdstringId of the custom field definition.
mappingKeystringStable key used to match the field.
fieldNamestringHuman-readable field name.
valueanyThe value (string, number, boolean, etc.).
typeenumThe 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

StatusMeaning
412 Precondition Failedid was missing from the body.
404 / Not FoundNo client with that id exists in your workspace.