Labor (technicians & crews)
Technicians, crews, skills, certifications, availability, shifts, work order assignments, labor actuals, and capacity views. Set tenant context before calling these methods.
Overview
The client.labor resource exposes read-only views and two RPCs for scheduling:
- Technicians and crews – workforce and team structure
- Skills and certifications – tenant catalogs and technician linkage
- Availability – recurring patterns and date overrides
- Shifts and shift templates – scheduled and on-call slots
- Work order assignments – which technicians are assigned to which work orders
- Labor actuals – aggregated time and cost per work order
- Technician capacity – scheduled minutes per technician per day
- RPCs – check shift conflicts, generate shifts from templates
Create/update/delete for technicians, crews, and related tables is done via the app schema (PostgREST or direct SQL) with RLS; the SDK focuses on reads and the two scheduling RPCs.
Technicians and crews
List technicians and crews for the current tenant.
client.labor.listTechnicians()
await client.setTenant(tenantId)
const technicians = await client.labor.listTechnicians()
// Returns TechnicianRow[]
client.labor.getTechnicianById(id)
const technician = await client.labor.getTechnicianById('uuid-of-technician')
// Returns TechnicianRow | null
client.labor.listCrews()
const crews = await client.labor.listCrews()
// Returns CrewRow[]
client.labor.getCrewById(id)
const crew = await client.labor.getCrewById('uuid-of-crew')
// Returns CrewRow | null
client.labor.listCrewMembers()
const members = await client.labor.listCrewMembers()
// Returns CrewMemberRow[]
client.labor.listCrewMembersByCrewId(crewId)
const members = await client.labor.listCrewMembersByCrewId('uuid-of-crew')
// Returns CrewMemberRow[]
Skills and certifications
List skill and certification catalogs and technician linkage.
client.labor.listSkillCatalogs()
const skills = await client.labor.listSkillCatalogs()
// Returns SkillCatalogRow[]
client.labor.listCertificationCatalogs()
const certs = await client.labor.listCertificationCatalogs()
// Returns CertificationCatalogRow[]
client.labor.listTechnicianSkills() / listTechnicianCertifications()
const technicianSkills = await client.labor.listTechnicianSkills()
const technicianCerts = await client.labor.listTechnicianCertifications()
// Returns TechnicianSkillRow[] and TechnicianCertificationRow[]
Availability and shifts
List availability patterns, overrides, shifts, and shift templates.
client.labor.listAvailabilityPatterns() / listAvailabilityOverrides()
const patterns = await client.labor.listAvailabilityPatterns()
const overrides = await client.labor.listAvailabilityOverrides()
// Returns AvailabilityPatternRow[] and AvailabilityOverrideRow[]
client.labor.listShifts() / listShiftsByTechnicianId(technicianId)
const shifts = await client.labor.listShifts()
const techShifts = await client.labor.listShiftsByTechnicianId('uuid-of-technician')
// Returns ShiftRow[]
client.labor.listShiftTemplates()
const templates = await client.labor.listShiftTemplates()
// Returns ShiftTemplateRow[]
Assignments and labor actuals
List work order assignments and aggregated labor actuals (time and cost per work order).
client.labor.listWorkOrderAssignments()
const assignments = await client.labor.listWorkOrderAssignments()
const forWorkOrder = await client.labor.listWorkOrderAssignmentsByWorkOrderId('uuid-of-work-order')
// Returns WorkOrderAssignmentRow[]
client.labor.listWorkOrderLaborActuals()
const actuals = await client.labor.listWorkOrderLaborActuals()
const forWorkOrder = await client.labor.listWorkOrderLaborActualsByWorkOrderId('uuid-of-work-order')
// Returns WorkOrderLaborActualsRow[] (entry_count, total_minutes, total_labor_cost_cents, etc.)
client.labor.listTechnicianCapacity()
const capacity = await client.labor.listTechnicianCapacity()
// Returns TechnicianCapacityRow[] (shift_date, shift_count, scheduled_minutes per technician)
Shift conflict detection
Check for overlapping shifts for a technician before creating or updating a shift. Pass excludeShiftId when updating so the current shift is not counted as a conflict.
client.labor.checkShiftConflicts(params)
const conflicts = await client.labor.checkShiftConflicts({
technicianId: 'uuid-of-technician',
startAt: '2026-03-15T08:00:00Z',
endAt: '2026-03-15T17:00:00Z',
excludeShiftId: null, // or shift id when updating
})
// Returns ShiftConflictRow[] (id, start_at, end_at, shift_type, label)
Generate shifts from templates
Generate shift rows from shift templates for a date range. Requires tenant membership. Returns the created shifts.
client.labor.generateShiftsFromTemplates(params)
const created = await client.labor.generateShiftsFromTemplates({
tenantId: 'uuid-of-tenant',
startDate: '2026-03-01',
endDate: '2026-03-31',
})
// Returns GeneratedShiftRow[]
- Name
tenantId- Description
Required. Tenant UUID.
- Name
startDate- Description
Required. Start date (YYYY-MM-DD).
- Name
endDate- Description
Required. End date (YYYY-MM-DD). Must be ≥ startDate.