الفريق والأسطول›Record a technician's time off (sick day, leave)
Record a technician's time off (sick day, leave)
Records a time-off block for a technician. The record is created PENDING; a business staff member approves it on the dashboard — EXCEPT for the sick-call flow, where `commitAbsenceResolve` approves the pending record that covers the absence itself. `start_datetime`/`end_datetime` are RFC3339 INSTANTS with an offset (e.g. `2030-06-15T04:00:00Z` for midnight Toronto), unlike the business-local naive datetimes used by scheduling calls — a whole day off is that day's local midnight to the next in UTC. Overlapping an existing record for the same technician is refused (`TIME_OFF_OVERLAP`); list `GET /technicians/{id}/time-off` first. Creating a record immediately flags the technician's jobs in that window as needing attention on the dispatch board. Supports Idempotency-Key.
المعاملات
Idempotency-Keystringheaderاختياري
Unique key making retries safe: a repeat send with the same key replays the original response (header Idempotent-Replayed: true) instead of re-running the operation. Reusing a key with a different body returns 422 IDEMPOTENCY_KEY_REUSE.
end_datetimestringbodyمطلوب
Block end — RFC3339 instant, must be after start_datetime. A whole day off runs local midnight to the next.
reasonstringbodyاختياري
Free-text reason, max 500 characters (e.g. "Sick call 06:58").
start_datetimestringbodyمطلوب
Block start — an RFC3339 instant WITH offset (e.g. 2030-06-15T04:00:00Z = midnight Toronto EDT), not a business-local naive datetime.
technician_idstringbodyمطلوب
The technician taking time off (must belong to the business).