Skip to main content

Maintenance

Maintenance events schedule planned work on a machine over a start and end time. All endpoints require a bearer JWT.

Endpoints

MethodPathDescription
POST/api/v1/maintenanceSchedule a maintenance event
GET/api/v1/maintenanceList maintenance events
GET/api/v1/maintenance/{event_id}Get a maintenance event
PUT/api/v1/maintenance/{event_id}Update a maintenance event
DELETE/api/v1/maintenance/{event_id}Delete a maintenance event

Schedule an event

POST /api/v1/maintenance

Requires an operator or administrator role.

FieldTypeRequiredDescription
machine_iduuidYesMachine the event applies to
titlestringYesEvent title (1–300 chars)
descriptionstringNoDetails (up to 4,000 chars)
scheduled_startdatetimeYesStart time (ISO 8601 UTC)
scheduled_enddatetimeYesEnd time (ISO 8601 UTC)
linked_alert_iduuidNoAlert that prompted this event
assigned_touuidNoUser the event is assigned to
recurrence_rulestringNoOne of daily, weekly, monthly, quarterly

When recurrence_rule is set, a series of child events is generated automatically from the parent.

{
"machine_id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Quarterly bearing inspection",
"description": "Check and replace main spindle bearings if needed.",
"scheduled_start": "2026-08-10T08:00:00Z",
"scheduled_end": "2026-08-10T12:00:00Z",
"recurrence_rule": "quarterly"
}

Response201 Created

{
"id": "dd44...",
"tenant_id": "3f2504e0-4f89-41d3-9a0c-0305e82c3301",
"machine_id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Quarterly bearing inspection",
"description": "Check and replace main spindle bearings if needed.",
"scheduled_start": "2026-08-10T08:00:00Z",
"scheduled_end": "2026-08-10T12:00:00Z",
"status": "scheduled",
"linked_alert_id": null,
"assigned_to": null,
"created_by": "3f2504e0-4f89-41d3-9a0c-0305e82c3301",
"created_at": "2026-08-07T10:00:00Z",
"recurrence_rule": "quarterly",
"parent_event_id": null
}

List events

GET /api/v1/maintenance

ParameterTypeDescription
machine_iduuidFilter by machine
statusstringOne of scheduled, in_progress, completed, cancelled
start_afterdatetimeEvents starting on or after this time
end_beforedatetimeEvents ending on or before this time

Returns an array of maintenance events.

Get an event

GET /api/v1/maintenance/{event_id}

Returns one event, or 404 if it is not found.

Update an event

PUT /api/v1/maintenance/{event_id}

Requires an operator or administrator role. Include only the fields you want to change.

FieldTypeDescription
titlestringNew title (1–300 chars)
descriptionstringNew description
scheduled_startdatetimeNew start time
scheduled_enddatetimeNew end time
statusstringOne of scheduled, in_progress, completed, cancelled
assigned_touuidNew assignee

Delete an event

DELETE /api/v1/maintenance/{event_id}

Requires an operator or administrator role. Returns 204 No Content.

Statuses

StatusDescription
scheduledPlanned, not yet started
in_progressWork underway
completedWork finished
cancelledEvent cancelled