--- type: API Endpoint title: Shift planning routes (employee) description: GET /api/shifts/available, GET /api/shifts/mine, POST/DELETE /api/shifts/:slotId/signup. resource: backend/src/routes/shifts.ts tags: [api, shift-planning] timestamp: 2026-08-16T00:00:00Z --- # Shift planning routes (employee) Mounted at `/api/shifts`. Every route requires `requireAuth` + `requireEmployee`. # Examples ``` GET /api/shifts/available?period=YYYY-MM 200 -> { "slots": AvailableSlot[] } ``` Open slots the employee isn't already signed up for. `period` defaults to the current month if omitted/invalid. Also the trigger point for lazily generating that month's template — see [shift_slots](/docs/data-model/shift-slots.md). ``` GET /api/shifts/mine?period=YYYY-MM 200 -> { "slots": MySlot[] } ``` ``` POST /api/shifts/:slotId/signup 201 -> { "ok": true } 400 -> collision with another approved slot, already full, already signed up, or the slot is closed — see [shift_signups](/docs/data-model/shift-signups.md) ``` ``` DELETE /api/shifts/:slotId/signup 204 on success 400 -> not signed up for that slot ``` # Related - [shift_slots](/docs/data-model/shift-slots.md), [shift_signups](/docs/data-model/shift-signups.md) - [Admin routes](./admin-routes.md) — the admin-side calendar, manual assignment, and month generation - [Frontend stores](/docs/frontend/stores.md) — `shiftPlanningStore`