SetOperators

[POST] .../v1/channel/setoperators

Replaces the full operator list for a CRM channel. Use this workflow method after Channel/Add or Channel/Get to replace all operators assigned to one CRM channel. The method deletes the previous operator list, inserts the provided active or inactive operator records, ignores items whose user_id is less than or equal to 0, invalidates chat entity-access and CRM channel caches and returns row_affected with the channel id. The request body is required and channel_id must be positive; operators can be null or an empty array to remove all operators from the channel. The caller must have CRM channel edit permission; missing body, invalid channel_id, denied access, missing channel, database failures, transaction failures and action-log errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
channel_id Int64 Required Channel ID.
operators Array of ChannelSetOperator Optional New operator list. An empty array removes all channel operators.

Request Example

{
  "channel_id": 3,
  "operators": [
    {
      "user_id": 12,
      "sort_order": 1,
      "max_active_leads": 20,
      "is_active": true
    },
    {
      "user_id": 18,
      "sort_order": 2,
      "max_active_leads": 15,
      "is_active": 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": [
      3
    ]
  }
}