Deucalion Docs
Scheduler Reference
ReferenceAn information-oriented lookup resource. Use it to find specific values and definitions.
adminschedulerapidata-typesreferencetechnical

API and Data Types Reference

Technical reference for the scheduler API endpoints, response shapes, core data types, and Zod validation schemas.

Before you start

  • You need the technical details behind the scheduler API for integration, debugging, or development.

Expected outcome

You understand every scheduler endpoint, the response structure, core data types, and validation schemas.

API endpoints

All scheduler routes are mounted under /scheduler and require the scheduler workspace bundle plus authenticated access. My Day Run is the exception — available to any authenticated user.

MethodPathPurpose
GET/scheduler/overviewFull scheduler state: jobs, engineers, stats, insights
GET/scheduler/my-day-runPersonal day-run for the authenticated user
GET/scheduler/day-runEngineer day-run plan with route suggestions
POST/scheduler/day-run/applyCommit suggested day-run stops
POST/scheduler/tasksCreate a planner task
PATCH/scheduler/tasks/:idUpdate a planner task
POST/scheduler/bulk-updateBulk update up to 100 jobs
POST/scheduler/history/:id/undoUndo a scheduler change
POST/scheduler/bulk-create-inspectionsBatch create up to 50 inspections
POST/scheduler/deploy/previewCheck deployment readiness for selected jobs
POST/scheduler/deploy/applyDeploy a batch and trigger engineer notifications
POST/scheduler/recurring-import/previewPreview a recurring CSV import
POST/scheduler/recurring-import/applyCommit a recurring import

Overview response shape

GET /scheduler/overview returns the complete scheduler state. All filter parameters are passed as query strings.

{
  jobs: SchedulerJob[],
  engineers: EngineerSummary[],
  filters: {
    start, end, engineerId, siteId, jobType, status, q,
    postcodeArea, region, equipment, ooh
  },
  stats: {
    totalJobs, scheduledJobs, unassignedJobs, overdueJobs,
    scheduledHours, conflictCount, unscheduledJobs,
    jobsWithWarnings, jobsWithBlockingWarnings, draftJobs,
    readyToDeployJobs, deployedTodayJobs, routeSuggestionCount,
    capacitySummary: {
      overloadedEngineers, availableEngineers,
      assignedHours, flaggedAssignments
    },
    warningBuckets: {
      blocked, flagged, unassigned, unscheduled,
      draft, ready, deployed, awaiting, acknowledged
    },
    actionCounts: {
      needsAssignment, needsScheduling, dueSoon,
      overloadedEngineers, readyToDeploy, draftJobs
    }
  },
  insights: {
    routeSuggestions: SchedulerRouteSuggestion[],
    recentChanges: SchedulerHistoryItem[],
    recentDeploymentBatches: DeploymentBatch[],
    selectionHints: { preferredAction, focusLabel }
  }
}

SchedulerJob type

The unified job object representing inspections, work orders, and planner tasks within the scheduler.

FieldTypeDescription
keystringUnique key: "entityType:id"
idstringEntity ID
entityType"inspection" | "work_order" | "task"Source entity type
jobTypestringSpecific type (e.g. annual, remedial, survey)
titlestringDisplay title
subtitlestring | nullSecondary display text
statusstringCurrent status
prioritystring | nulllow, normal, high, urgent
scheduledDatestring | nullISO datetime for exact scheduling
targetMonthstring | nullYYYY-MM for month-level planning
deploymentState"draft" | "deployed"Current deployment state
deployedAtstring | nullISO datetime of last deployment
deployReadybooleanWhether the job can be deployed
engineerAcknowledgedAtstring | nullISO datetime when the engineer acknowledged the deployed work (via opening their day run). null if not yet acknowledged or not deployed.
deployBlockedReasonsstring[]Reasons blocking deployment
estimatedDurationMinutesnumberEstimated work duration
scheduleWindowStartstring | nullEarliest acceptable date
scheduleWindowEndstring | nullLatest acceptable date
scheduleFlexDaysnumber | nullAcceptable flex around scheduled date (0-120)
siteIdstring | nullAssociated site
siteNamestring | nullSite display name
systemIdstring | nullAssociated system
systemNamestring | nullSystem display name
citystring | nullSite city
postcodestring | nullSite postcode
postcodeAreastring | nullExtracted area code (e.g. SW from SW1A 1AA)
latitudestring | nullSite latitude
longitudestring | nullSite longitude
engineerIdsstring[]Assigned engineer IDs
engineerNamesstring[]Assigned engineer display names
requiredCompetenciesstring[]Computed competency requirements
crewSizeRequirednumberNumber of crew required (default 1)
accessEquipmentstring[]Normalised equipment values
outOfHoursbooleanOut-of-hours flag
siteAccessNotesstring | nullCombined site access notes
siteSchedulingRulesobject | nullSite-level scheduling constraints
validationWarningsSchedulerWarning[]Current warnings
detailHrefstring | nullLink to the entity detail page

BulkUpdatePatch type

Sent to POST /scheduler/bulk-update. All fields are optional — only included fields are applied.

FieldTypeConstraints
engineerIdstring | nullMust be a valid org member with canBeScheduled
scheduledDatestring | nullISO datetime; mutually exclusive with targetMonth
targetMonthstring | nullYYYY-MM; mutually exclusive with scheduledDate
estimatedDurationMinutesnumber | null15-1440
prioritystringlow, normal, high, urgent
statusstring | nullpending, in_progress, completed, cancelled
scheduleWindowStartstring | nullISO datetime
scheduleWindowEndstring | nullISO datetime
scheduleFlexDaysnumber | null0-120
crewSizeRequirednumber | null1-50
accessEquipmentstring[] | nullValidated against VALID_EQUIPMENT enum
outOfHoursboolean

EngineerSummary type

FieldTypeDescription
userIdstringEngineer user ID
role"owner" | "admin" | "engineer"Organisation role
canManageSchedulebooleanWhether the user can manage the scheduler
canBeScheduledbooleanWhether the user can receive job assignments
schedulerProfileobject | nullAvailability and capacity settings
userobject{ id, name, email }

Defaults and constants

ConstantValueUsed by
DEFAULT_INSPECTION_FLEX_DAYS21Inspection scheduling flex
DEFAULT_WORK_FLEX_DAYS14Work order scheduling flex
DEFAULT_SHIFT_START_MINUTES480 (08:00)Day-run and capacity calculations
DEFAULT_SHIFT_END_MINUTES1020 (17:00)Day-run and capacity calculations
VALID_EQUIPMENT7 valuesEquipment validation set
Max bulk update100 jobsBulk update endpoint
Max batch inspections50Batch creation endpoint
Duration range15-1440 minutesAll scheduling endpoints
Flex range0-120 daysAll scheduling endpoints
Crew range1-50All scheduling endpoints

How the scheduler connects to other workspaces

WorkspaceConnection
InspectionsCreated in the portal or via batch import, appear as schedulable jobs
Work ordersCreated from accepted quotes or standalone, carry hold/resume lifecycle
SitesProvide geographic data, scheduling rules, and access notes
EngineersForm the assignment pool; availability and competencies tracked by capacity system
DeploymentPushes scheduled work to the engineer's mobile day run
FinanceFollows after completed work; scheduler surfaces jobs needing invoicing
AI AssistantCan be launched with current scheduler context for analysis

On this page