SetParticipants

[POST] .../v1/chat/setparticipants

Adds or updates chat participants. Use this method to replace or upsert the participant list of a manageable standalone chat after creating or editing the chat. The request body is required, id must contain the chat UUID and participants must contain at least one valid User or Client participant with a supported Staff or Member role. The current request user needs chat edit permission or chat manage-all permission; linked CRM or task chats can require participant changes through their owning entity workflow. Missing body, missing id or participants, invalid participant type or role, denied permission, closed or missing chat, linked entity restrictions and database failures are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
id String Required Chat UUID.
participants Array of ChatParticipantAddEdit Required Participants to add or update.

Request Example

{
  "id": "8cdd646d-dbd0-45c0-8f5b-d90a9b000001",
  "participants": [
    {
      "entity_type": "User",
      "entity_id": 42,
      "role": "Staff"
    },
    {
      "entity_type": "User",
      "entity_id": 64,
      "role": "Member"
    }
  ]
}

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
  }
}