API reference · Assets
GET/api/v1/assets/export

Export assets

Exports assets for the authenticated tenant. The controller validates assetExportQuerySchema, but currently ignores the validated filters and include flags and calls AssetService.list with default options. When format=csv or omitted, it returns text/csv with Content-Disposition attachment filename=assets.csv. When format=json or format=xlsx, it returns a JSON success envelope; xlsx generation is not implemented. In the current route wiring, req.context may be absent because no route-level API-key auth wrapper sets it, causing a 500 before export.

RBAC · asset

Query parameters

formatstringOptional
Export format. csv returns text/csv; json and xlsx currently return the same JSON envelope.
include_extension_datastringOptional
Accepted by validation, but currently ignored by ApiAssetController.export.
include_maintenancestringOptional
Accepted by validation, but currently ignored by ApiAssetController.export.
include_documentsstringOptional
Accepted by validation, but currently ignored by ApiAssetController.export.
asset_typesarray of stringOptional
Accepted by validation as an array, but the controller builds query values with Object.fromEntries and does not apply this filter.
statusesarray of stringOptional
Accepted by validation as an array, but not currently applied.
client_idsarray of stringOptional
Accepted by validation as an array, but not currently applied.
fieldsarray of stringOptional
Accepted by validation as an array, but not currently used to select export columns.

Response body

Success response 200 · schema AssetExportJsonResponse

successbooleanRequired
Enum: true
dataobjectRequired
dataarray of AssetResourceRequired
All asset rows returned by AssetService.list with default list options. Export filters are currently not applied.
itemsobject
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 export returned successfully. For format=csv or omitted, the handler returns text/csv with an attachment filename; for format=json or format=xlsx, the handler currently returns this JSON envelope.
400
Query parameter validation failed.
401
x-api-key is missing at middleware.
403
Authenticated request context lacks permission to read/export assets when auth wiring is present.
500
Unexpected error, including missing req.context in the current route wiring.