SetGroups

[POST] .../v1/workscheduleassignment/setgroups

Assigns schedules to groups Use this method to add group-level schedule assignments that can apply to users through their group membership. The method validates the non-empty assignments array, validates each group_id, schedule_id, date_from, optional date_to and priority, checks permission 694, verifies that every schedule exists, inserts the group assignments, writes action log entries and returns row_affected with created assignment ids. The request body is required, date_from and date_to use account date format, date_to cannot be earlier than date_from and priority is used when several group assignments match the same user and date. Missing body, empty assignments, invalid ids or dates, missing schedule, denied permission and database errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
assignments Array of WorkGroupScheduleSetItem Required Group assignment list.

Request Example

{
  "assignments": [
    {
      "group_id": 3,
      "schedule_id": 14,
      "date_from": "2026-03-01",
      "date_to": null,
      "priority": 10
    }
  ]
}

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