Edit

[POST] .../v1/workschedule/edit

Edits work schedule. Use this method to change an existing work schedule without replacing its intervals or assignments. The method validates id, optional schedule_type and optional check_in_allowed_ips, checks work schedule edit permission 691, rejects deactivating the account default schedule, updates provided fields, writes an action log record, invalidates WorkTime cache and returns row_affected with changed ids. The request body is required, id must be positive, null check_in_allowed_ips keeps the current restriction and an empty array clears the restriction. Missing body, invalid id, invalid schedule_type, invalid or unsupported IP/CIDR restrictions, missing schedule, default schedule deactivation, denied permission and database errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
active Boolean Optional Active schedule flag.
check_in_allowed_ips Array of String Optional Allowed IP/CIDR values for check-in. null keeps the current restriction and an empty array clears it.
check_in_early_sec Int32 Optional Allowed early check-in time in seconds.
check_in_late_sec Int32 Optional Allowed late check-in time in seconds.
id Int64 Required Schedule ID.
name String Optional Schedule name. Stored in a database field with a 200 character limit.
schedule_type String Optional Schedule type: Weekly or Shift. Allowed values: Default, Weekly, Shift.

Request Example

{
  "id": 14,
  "name": "Front desk weekly schedule",
  "check_in_late_sec": 900,
  "check_in_allowed_ips": []
}

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