Skip to navigation

Add Shift

Adds a new shift to your company. Shared rules: see Writing data.

  • name must be unique in the company, ignoring upper/lower case and outer spaces. A second shift with the same name is refused with 400, so repeating is harmless.
  • start_time and end_time are 24-hour HH:MM. If end_time is the same as or earlier than start_time, the shift runs overnight (for example 22:00-06:00); this needs the Night Shift plan feature.
  • min_punch_in_minutes is how many minutes before the shift starts a punch-in is accepted; max_punch_out_minutes is how many minutes after it ends a punch-out is accepted. Leave out for no limit. Either needs the Shift Time Limits plan feature.
  • GET /attendance/shift returns these limits as min_punch_in_duration / max_punch_out_duration in seconds; writes use minutes.

Authentication

AuthorizationApi-Key

Format: “Api-Key {api-key}”

Request

This endpoint expects an object.
namestringRequired1-100 characters
Shift name. Unique in the company, ignoring case.
start_timestringRequiredformat: "^\d{2}:\d{2}$"

Start time, 24-hour HH:MM.

end_timestringRequiredformat: "^\d{2}:\d{2}$"

End time, 24-hour HH:MM. Same as or earlier than start_time means an overnight shift (needs Night Shift).

min_punch_in_minutesintegerOptional0-1439

Minutes before the shift starts that a punch-in is accepted. Leave out for no limit (needs Shift Time Limits).

max_punch_out_minutesintegerOptional0-1439

Minutes after the shift ends that a punch-out is accepted. Leave out for no limit (needs Shift Time Limits).

Response

The shift was created.
messagestring
statusboolean
dataobject

Errors

400
Bad Request Error
403
Forbidden Error