Skip to main content

Shift Management

Define shift schedules, log shift activities, generate handover reports, and compare shift performance.

Shift definitions

List definitions

GET /shifts/definitions

Auth: Bearer JWT (any role)

ParameterTypeDefault
active_onlybooleantrue

Create a definition

POST /shifts/definitions

Auth: Bearer JWT (admin)

{
"name": "Morning Shift",
"start_time": "06:00",
"end_time": "14:00",
"color": "#3B82F6",
"is_active": true
}

Update / Delete

PUT /shifts/definitions/{id} | DELETE /shifts/definitions/{id}

Shift logs

List logs

GET /shifts/logs

ParameterTypeDescription
machine_iduuidFilter by machine
from_datedateStart date
to_datedateEnd date
statusstringactive, completed, cancelled

Create a log

POST /shifts/logs

Auth: Bearer JWT (admin, operator)

Update / Delete a log

PATCH /shifts/logs/{id} | DELETE /shifts/logs/{id}

Handover reports

GET /shifts/logs/{log_id}/handover

Auth: Bearer JWT (any role)

Generates a handover report with context from the last 24 hours, including alerts, downtime events, and maintenance activities.

Shift comparison

GET /shifts/comparison

Compare performance metrics (OEE, downtime, output) across shifts.

Active shifts

GET /shifts/active

Returns all currently active shift logs.