Downtime Tracking
Record, analyze, and report on machine downtime events.
Create a downtime record
POST /machines/{machine_id}/downtime
Auth: Bearer JWT (admin, operator)
curl -X POST https://api.haltless.io/api/v1/machines/MACHINE_ID/downtime \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"reason": "Unplanned bearing failure",
"category": "unplanned",
"reason_code_id": "REASON_CODE_UUID",
"started_at": "2026-04-04T08:15:00Z"
}'
Categories: planned, unplanned, changeover, maintenance
List downtime records
GET /machines/{machine_id}/downtime
Auth: Bearer JWT (any role)
Update a downtime record
PUT /machines/{machine_id}/downtime/{record_id}
Auth: Bearer JWT (admin, operator)
End a downtime event
POST /machines/{machine_id}/downtime/{record_id}/end
Auth: Bearer JWT (admin, operator)
Sets ended_at to the current time and calculates duration.
Uptime summary
GET /machines/{machine_id}/uptime-summary
Auth: Bearer JWT (any role)
| Parameter | Type | Description |
|---|---|---|
start | datetime | Start of analysis period |
end | datetime | End of analysis period |
MTTR / MTBF
GET /machines/{machine_id}/mttr-mtbf
Auth: Bearer JWT (any role)
| Parameter | Type | Default | Description |
|---|---|---|---|
days | int | 90 | Lookback window |
{
"mttr_hours": 2.5,
"mtbf_hours": 168.0,
"total_failures": 5,
"total_repairs": 7
}
- MTTR (Mean Time To Repair): Average repair duration for
unplannedandmaintenanceevents - MTBF (Mean Time Between Failures): Average uptime between
unplannedfailure events
Fleet downtime
GET /fleet/downtime
Auth: Bearer JWT (any role)
Paginated list of all downtime records across the fleet.
| Parameter | Type | Description |
|---|---|---|
machine_id | uuid | Filter by machine |
sort_by | string | Sort field |
sort_dir | string | asc or desc |
Fleet MTTR / MTBF
GET /fleet/mttr-mtbf
Auth: Bearer JWT (any role)
Aggregated MTTR and MTBF across the entire fleet.
Reason codes
Reason codes provide a hierarchical taxonomy for categorizing downtime causes.
List reason codes
GET /reason-codes
| Parameter | Type | Default |
|---|---|---|
active_only | boolean | true |
Reason code tree
GET /reason-codes/tree
Returns reason codes as a nested tree (parent-child hierarchy).
Create a reason code
POST /reason-codes
Auth: Bearer JWT (admin)
Update a reason code
PUT /reason-codes/{code_id}
Auth: Bearer JWT (admin)