Create Shift
Creates a shift in Attendance — fixed (the same weekly schedule every week) or rotating (a repeating pattern of work and rest blocks) — exactly as an administrator would from Crehana, and returns its id. Built for HR and workforce-planning systems that own the schedules. Step-by-step guide: Create shifts.
shift_type decides the body: NON_ROTATING takes weekly_schedule, ROTATING takes cycles. The answer carries the id of the shift and, for a rotating one, the id of each cycle: the shift_id and start_cycle_id that Assign Shift needs.
- Times are
HH:MM. An exit earlier than the entry means the day ends the next day (night shift). - Days not sent in
weekly_scheduleare rest days. - Breaks go in
break_config(type and deduction) plus, per working day or work cycle,break_time_slots(FIXED_SCHEDULE) orbreak_duration_minutes(FIXED_DURATION). - Worked minutes are calculated by Crehana unless
edit_worked_minutesis true. - A schedule that breaks a rule of Attendance (no working day, a break outside the day, a rotating shift without a rest block, …) is a
400with the rule in the message. - The name is unique among the active shifts of the organization: sending it again is a
409with the id of the existing shift, so a retry never creates a duplicate. - Requires credentials of an administrator of the organization.
Authentication
API key of the organization. Always sent together with the Secret-Access header.
Path parameters
Headers
Request
Response
attendance-005 when the shift was created. Not an HTTP status.
A shift as stored in Attendance. weekly_schedule only for a fixed one, cycles only for a rotating one.
