API reference · Assets
PUT/api/v1/assets/{id}

Update asset

Partially updates base asset fields for the authenticated tenant. The request body is validated with updateAssetSchema, where all fields are optional. AssetService.update scopes the update by asset_id and context.tenant, writes updated_at, publishes ASSET_UPDATED, and returns the refreshed base asset with joined client_name and warranty_status. This REST path does not update extension data, create asset history records, or wrap the update in a transaction. Missing assets currently lead to a 500 when the controller tries to add links to a null result rather than a clean 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

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

Request body

Content type: application/json · schema AssetUpdateData

client_idstring <uuid>
Client UUID to assign to the asset.
asset_typestring
Asset type to store in assets.asset_type.
Enum: workstationnetwork_deviceservermobile_deviceprinterunknown
asset_tagstring
Tenant-specific asset tag.
min length 1 · max length 255
namestring
Asset name.
min length 1 · max length 255
statusstring
Asset status.
min length 1
locationstring
Asset location.
serial_numberstring
Serial number.
purchase_datestring <date-time>
Purchase date/time.
warranty_end_datestring <date-time>
Warranty end date/time.

Response body

Success response 200 · schema AssetResourceResponse

successbooleanRequired
Enum: true
dataobjectRequired
dataobjectRequired
asset_idstring <uuid>Required
Primary key from assets.asset_id.
client_idstring <uuid>Required
Client UUID from assets.client_id.
asset_typestringRequired
Asset type stored in assets.asset_type.
Enum: workstationnetwork_deviceservermobile_deviceprinterunknown
asset_tagstringRequired
Tenant-specific asset tag.
namestringRequired
Asset display name.
statusstringRequired
Asset status.
locationstringNullable
Asset location, when recorded.
serial_numberstringNullable
Asset serial number, when recorded.
purchase_datestringNullable
Asset purchase date from assets.purchase_date.
warranty_end_datestringNullable
Warranty end date from assets.warranty_end_date.
created_atstring <date-time>Required
Asset creation timestamp.
updated_atstring <date-time>Required
Asset last update timestamp.
tenantstring <uuid>Required
Tenant UUID from assets.tenant; filtered to the authenticated request context.
client_namestring
Client name selected from the joined clients table.
warranty_statusstring
Computed from warranty_end_date by SQL CASE expression.
Enum: no_warrantyexpiredexpiring_soonactive
maintenance_statusstring
Optional computed maintenance status when present in service results.
extension_dataobject
relationshipsarray of object
Related asset rows included by getWithDetails after create.
itemsobject
documentsarray of object
Associated document rows included by getWithDetails after create.
itemsobject
maintenance_schedulesarray of object
Maintenance schedule rows included by getWithDetails after create.
itemsobject
_linksobject
HATEOAS links generated from the asset_id.
metaobjectRequired
timestampstring <date-time>Required
Response timestamp generated by createApiResponse/createErrorResponse.
versionstringRequired
API response version string.

Response codes

200
Asset updated successfully.
400
Request body validation failed, or the database rejected an invalid reference.
401
x-api-key is missing at middleware.
403
Authenticated request context lacks permission to update assets when auth wiring is present.
404
Intended not-found response for missing assets; the current controller path may surface this as 500.
409
Database unique constraint conflict, such as a duplicate asset tag if enforced by schema.
500
Unexpected error, including missing req.context or null asset result handling in the current route wiring.