SetDefault

[POST] .../v1/workschedule/setdefault

Sets a work schedule as the default account schedule Use this method to make one existing schedule the active account default used when no more specific user or group assignment applies. The method validates id, checks work schedule edit permission 691, clears the previous default schedule flag, activates the selected schedule as the new default, writes an action log record, invalidates WorkTime cache and returns row_affected with changed ids. The request body is required and id must point to an existing non-deleted schedule. Missing body, invalid id, denied permission, missing schedule and database errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
id Int64 Required ID of the schedule that becomes the default.

Request Example

{
  "id": 14
}

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