Edit

[POST] .../v1/client/edit

Updates a CRM client. Update client contact data, profile text, avatar URL or custom fields while keeping responsible-user assignment in the dedicated Client/SetResponsible workflow. The method loads the current non-deleted client, rejects responsible_user_id changes, updates only provided scalar fields, applies custom field changes when allowed, sends the ClientEdited webhook and returns row_affected with the client id. The request body is required; id must be positive, string fields follow the database limits documented in the schema and responsible_user_id must not be sent to this method. The caller must have CRM client edit permission; missing body, invalid id, denied access, missing client, responsible-user misuse, disabled additional fields, custom-field failures, storage errors are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
description String Optional Client comment.
email String Optional Client email address. Maximum length is 150 characters.
external_id String Optional External client ID. Maximum length is 150 characters.
fields Array of FieldValueEdit Optional Custom field changes.
id Int64 Required Client ID.
name String Optional Client name. Maximum length is 200 characters.
phone String Optional Client phone number. Maximum length is 50 characters.
photo_url String Optional Avatar URL. Maximum length is 500 characters.
responsible_user_id Int64 Optional Not changed through Client/Edit. Passing this field returns 1008/responsible_user_id_use_setresponsible.

Request Example

{
  "id": 126,
  "name": "Maria Sokolova",
  "phone": "\u002B998933334400",
  "fields": []
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Update Update operation result.

Response Example

{
  "ok": true,
  "result": {
    "row_affected": 1,
    "ids": [
      126
    ]
  }
}