Shift Roster Generator & Checker (VN Labour Code)
Generate a monthly shift roster (3 shifts 4 crews, 2×12 h…) or check yours: 12 h rest, weekly rest, 12 h/day, 40 h overtime/month, night work, holidays.
Result
Press “Run” to see the result.
action=generate (default) builds a month (month=YYYY-MM, or from/to, max 31 days) for employees (names, or objects with no_night, off dates, max_shifts) or count people. pattern picks the shifts: 3x8-4crew (3 ca 4 kíp: 8-day cycle S S C C D D O O, crews offset by 2 days), 2x12-3crew, 2x12-4crew, 3x8, 2x12, office, or your own shifts ([{ code, start, end, break_minutes }]). With demand (people per shift) a greedy planner fills each shift with the least-loaded eligible person, spreads nights and weekends, keeps ≥ 12 h between shifts, ≤ 6 working days in a row and the weekly normal-hours cap, and reports unfilled slots (partial=true).
action=check takes your roster ({ "Name": { "2026-12-01": "S", … } } or [{ employee, date, shift }]) and lists violations: more than 12 h of work in a day (BLLĐ Điều 107), less than 12 h of rest at a shift change (Điều 110), no 24 consecutive hours off in a 7-day block or fewer than 4 days off a month (Điều 111), overtime above 40 h/month and the yearly pace above 200 h (or overtime_year_cap=300), work on public holidays (overtime, from /v1/vn-holidays) and breaks to give inside shifts of 6 h or more (Điều 109). regime=daily uses the 8 h/day normal limit, weekly (default) 10 h/day and 48 h/week (normal_week_hours).
Results: per-employee hours, night hours (22:00–06:00), overtime, weekend and holiday shifts, and the roster grid. format=xlsx returns the roster sheet with a warnings sheet, format=ics one calendar event per shift. Up to 200 employees.
Use this in your code
curl "https://apibox.io.vn/v1/vn-shift-roster?pattern=3x8-4crew&count=8&month=2026-12" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch('https://apibox.io.vn/v1/vn-shift-roster?pattern=3x8-4crew&count=8&month=2026-12', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const data = await res.json();
console.log(data);import requests
res = requests.get(
"https://apibox.io.vn/v1/vn-shift-roster?pattern=3x8-4crew&count=8&month=2026-12",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/vn-shift-roster?pattern=3x8-4crew&count=8&month=2026-12');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));API documentation → Get a free API key
FAQ
Are 12-hour shifts legal?
A day may have at most 12 h of normal + overtime work; with a weekly regime normal hours are ≤ 10 h/day, so each 12-hour shift carries overtime and 2-shift 3-crew patterns usually exceed 40 h overtime per month.
How long between two shifts?
At least 12 hours before moving to another shift (BLLĐ Điều 110).
Is it an optimiser?
No: a fast greedy planner with hard limits. It reports unfilled slots instead of breaking the rules.