Edit

[POST] .../v1/deal/edit

Edits a CRM deal. Use this method to update deal fields, amount, currency, deal type, task link, description mentions and custom fields while keeping stage movement in Deal/SetStage or Deal/Close. The method loads the active deal, rejects stage_id changes and pipeline changes, validates task access and task-link uniqueness, validates currency and deal type, applies scalar and custom-field changes, optionally updates description mentions and auto-added participants, synchronizes task links and the linked chat, writes chat system messages and action logs, sends DealEdited and related participant/stage/mention notifications and returns row_affected with the deal id. The request body is required; id must be positive, task_id can be 0 to unlink the task, description_mentions can be sent only together with description and title is limited by the schema. The caller must have CRM deal edit permission or CRM manage-all access; missing body, invalid id or linked ids, missing deal/task/currency/deal type, denied pipeline access, stage or pipeline misuse, duplicate task links, disabled additional fields, required custom-field failures, mention validation failures, participant-permission failures, database errors, transaction failures and action-log errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
amount Decimal Optional Deal amount.
currency_id Int64 Optional Currency ID from ctlg_common_currency_ref.crnc_id.
deal_type_id Int64 Optional Deal type ID.
description String Optional Deal description.
description_mentions Array of CommonMentionInput Optional New structured user mentions in description.
fields Array of FieldValueEdit Optional Custom field changes.
id Int64 Required Deal ID.
mention_options CommonMentionOptions Optional Mention processing options.
pipeline_id Int64 Optional Pipeline changes through edit are not allowed. Use the dedicated stage or pipeline change scenario.
stage_id Int64 Optional Stage changes through edit are not allowed. Use deal/setstage.
task_id Int64 Optional Linked project task ID. Use 0 to unlink the task.
title String Optional Deal title. Maximum length is 300 characters.

Request Example

{
  "id": 230,
  "deal_type_id": 3,
  "title": "Website wholesale deal - confirmed",
  "description": "Client confirmed the first purchase list",
  "amount": 3200.00,
  "currency_id": 1,
  "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": [
      230
    ]
  }
}