Assets API
POST/api/v1/assets/{id}/tickets
Product availabilityAlgaPSA

Link a ticket to an asset

Creates an asset_associations row (entity_type=ticket) linking the path asset to the ticket in the request body. This is the same table the asset detail UI, GET /api/v1/assets/{id}/tickets, and GET /api/v1/tickets/{id}/assets read, so the link is immediately visible from both sides. relationship_type defaults to affected. The route is authenticated and tenant-scoped via withApiKeyRouteAuth and enforces asset:update (the asset associations are being mutated) plus ticket:read (the ticket is only referenced). Both the asset and the ticket must exist in the tenant (404 otherwise), and a duplicate link returns 409.

RBAC · asset

Path parameters

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

Request body

Content type: application/json · schema AssetTicketLinkRequest

ticket_idstring <uuid>Required
Ticket UUID to link to the asset.
relationship_typestring
Optional association type; defaults to affected.
min length 1
notesstring
Optional notes stored on asset_associations.notes.

Response body

Success response 201 · schema AssetTicketLinkResponse

successbooleanRequired
Enum: true
dataobjectRequired
tenantstring <uuid>Required
Tenant UUID from asset_associations.tenant.
asset_idstring <uuid>Required
Asset UUID from asset_associations.asset_id.
entity_idstring <uuid>Required
Linked entity UUID — the ticket_id, from asset_associations.entity_id.
entity_typestringRequired
Always 'ticket' for these endpoints.
Enum: ticket
relationship_typestringRequired
Association type from asset_associations.relationship_type (defaults to affected).
notesstringNullable
Optional notes from asset_associations.notes.
created_bystring <uuid>Required
Creator user UUID from asset_associations.created_by.
created_atstringRequired
Link creation timestamp from asset_associations.created_at.
metaobjectRequired
timestampstring <date-time>Required
Response timestamp generated by createApiResponse/createErrorResponse.
versionstringRequired
API response version string.

Response codes

201
Ticket linked. Returns the inserted asset_associations row.
400
Request body validation failed.
401
x-api-key missing/invalid.
403
Caller lacks asset:update or ticket:read.
404
Asset or ticket not found in the tenant.
409
Ticket is already linked to this asset.
500
Unexpected error.