SetParticipants

[POST] .../v1/lead/setparticipants

Updates CRM lead participants. Use this workflow method to replace or extend the staff participant list for an active CRM lead and keep the linked chat participants in sync. The method validates the lead, participant-management permission, pipeline access and active lead status, normalizes participant_user_ids, keeps the responsible user in the participant context, updates lead participants, synchronizes chat staff participants, writes a chat system message and action log, sends LeadParticipantsSet webhook and participant notifications and returns row_affected with the lead id. The request body is required and id must be positive; replace_mode true replaces the participant list, while false adds the provided users to the existing list. The caller must have CRM lead participants-manage permission; missing body, invalid id, missing lead, denied access, pipeline ACL failures, closed or converted lead status, database errors, transaction failures and action-log errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
id Int64 Required Lead ID.
participant_user_ids Array of Int64 Optional Participant user IDs.
replace_mode Boolean Optional Update mode. true replaces the participant list; false adds users to the current list.

Request Example

{
  "id": 105,
  "participant_user_ids": [
    18,
    31
  ],
  "replace_mode": true
}

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": [
      105
    ]
  }
}