API reference · Assets
GET/api/v1/assets/{id}/history

List asset maintenance history

Returns all maintenance history rows for the path asset ID in the authenticated tenant, ordered by performed_at descending. The service joins users to add performed_by_user_name and filters asset_maintenance_history by asset_id and context.tenant. It performs no asset existence check, so nonexistent or cross-tenant asset IDs return 200 with an empty array. Response links currently point at /api/v2/assets paths. In the current v1 asset route wiring, req.context may be absent because no route-level API-key auth wrapper sets it, causing a 500 before lookup.

RBAC · asset

Path parameters

idstring <uuid>Required
Asset UUID from assets.asset_id.

Response body

Success response 200 · schema AssetMaintenanceHistoryResponse

successbooleanRequired
Enum: true
dataobjectRequired
dataarray of AssetMaintenanceHistoryResourceRequired
Maintenance history rows ordered by performed_at descending.
itemsobject
history_idstring <uuid>Required
Primary key from asset_maintenance_history.history_id.
asset_idstring <uuid>Required
Asset UUID from asset_maintenance_history.asset_id.
schedule_idstring <uuid>Nullable
Optional related maintenance schedule UUID.
maintenance_typeanyOfRequired
Maintenance type recorded for the history row.
anyOf (option 1)string
Enum: preventivecorrectiveinspectioncalibrationreplacement
anyOf (option 2)string
performed_bystring <uuid>Required
User UUID supplied in the maintenance record.
performed_atstring <date-time>Required
Timestamp when maintenance was performed.
duration_hoursnumberNullable
Maintenance duration in hours, when recorded.
costnumberNullable
Maintenance cost, when recorded.
notesstringNullable
Free-text notes.
parts_usedarray of stringNullable
Parts used, when recorded.
itemsstring
maintenance_dataobjectNullable
Arbitrary structured maintenance data.
descriptionstringNullable
Description column when present in the maintenance history table.
created_atstring <date-time>Required
History creation timestamp.
tenantstring <uuid>Required
Tenant UUID scoped from the request context.
performed_by_user_namestringNullable
Concatenated user name from the joined users table.
_linksobjectRequired
History links. The controller currently points these at /api/v2/assets paths.
selfobject
hrefstringRequired
Target URL for the related operation.
methodstring
HTTP method for the link when supplied.
schedulesobject
hrefstringRequired
Target URL for the related operation.
methodstring
HTTP method for the link when supplied.
parentobject
hrefstringRequired
Target URL for the related operation.
methodstring
HTTP method for the link when supplied.
metaobjectRequired
timestampstring <date-time>Required
Response timestamp generated by createApiResponse/createErrorResponse.
versionstringRequired
API response version string.

Response codes

200
Maintenance history rows returned successfully.
401
x-api-key is missing at middleware.
403
Authenticated request context lacks permission to read asset history when auth wiring is present.
500
Unexpected error, including missing req.context in the current route wiring.