API reference · Assets
PUT/api/v1/assets/maintenance/{scheduleId}

Update asset maintenance schedule

Updates a maintenance schedule by asset_maintenance_schedules.schedule_id for the authenticated tenant. All request fields are optional because updateMaintenanceScheduleSchema is a partial form of the create schema. If frequency, frequency_interval, or start_date are supplied, the service loads the existing schedule for the tenant and recalculates next_maintenance. Missing or cross-tenant schedule IDs result in a 200 response with an undefined nested data value rather than 404. In the current route wiring, req.context may be absent because no route-level API-key auth wrapper sets it, causing a 500 before update.

RBAC · asset

Path parameters

scheduleIdstring <uuid>Required
Maintenance schedule UUID from asset_maintenance_schedules.schedule_id.

Request body

Content type: application/json · schema AssetMaintenanceScheduleUpdateRequest

schedule_typestring
Type of maintenance schedule.
Enum: preventiveinspectioncalibrationreplacement
frequencystring
Recurrence frequency. Changing this triggers next_maintenance recalculation.
Enum: dailyweeklymonthlyquarterlyyearlycustom
frequency_intervalnumber
Frequency multiplier used when calculating the next maintenance date.
≥ 1
start_datestring <date-time>
Schedule start date/time. Changing this triggers next_maintenance recalculation.
end_datestring <date-time>
Optional schedule end date/time.
notesstring
Free-text schedule notes.
assigned_tostring <uuid>
Assigned user UUID from users.user_id.
is_activeboolean
Whether the schedule is active.
schedule_configobject
Custom scheduling configuration.

Response body

Success response 200 · schema AssetMaintenanceScheduleResponse

successbooleanRequired
Enum: true
dataobjectRequired
dataobject
schedule_idstring <uuid>Required
Primary key from asset_maintenance_schedules.schedule_id.
asset_idstring <uuid>Required
Asset UUID from asset_maintenance_schedules.asset_id.
schedule_typestring
Maintenance schedule type as used by ApiAssetController.
frequencystring
Recurrence frequency.
frequency_intervalnumberNullable
Frequency multiplier.
start_datestringNullable
Schedule start date/time.
end_datestringNullable
Schedule end date/time.
last_maintenancestringNullable
Last recorded maintenance date/time.
next_maintenancestringNullable
Next calculated maintenance date/time.
notesstringNullable
Free-text schedule notes.
assigned_tostring <uuid>Nullable
Assigned user UUID.
is_activeboolean
Whether the schedule is active.
schedule_configobjectNullable
Custom scheduling configuration.
created_atstring <date-time>
Creation timestamp.
updated_atstring <date-time>
Last update timestamp.
tenantstring <uuid>Required
Tenant UUID scoped from the request context.
metaobjectRequired
timestampstring <date-time>Required
Response timestamp generated by createApiResponse/createErrorResponse.
versionstringRequired
API response version string.

Response codes

200
Maintenance schedule updated successfully. If the ID is not found, the nested data field may be absent.
400
Request body validation failed.
401
x-api-key is missing at middleware.
403
Authenticated request context lacks permission to update asset maintenance schedules when auth wiring is present.
500
Unexpected error, including missing req.context in the current route wiring.