Skip to content

Assets ​

Overview ​

An asset is a DigitalAssets row plus one AssetsVersion row per version. The current version is the one in digital_assets.assets_version_id; most file columns (file_name, thumbnail_file, compress_file, file_size, width, height) are copied onto both rows. Files live on the s3 disk under {workspace url_slug}/digital_assets/, with thumbnail/, compress/ and video_preview/ sub-paths for renditions.

Admin API (/api/v1/digital-assets/..., auth:api, checkUserWithWS, setEtag, IfNoneMatchEtag) owns upload, edit, move, copy, duplicate, versions, archive, trash, embed codes and analytics. Portal API (/dam/v1/digital/...) is read and download only. External API (/external/v1/...) lets integrations read, download, tag and embed.

Almost every admin action starts with the same guard: resolve the workspace from url_workspace_id (or workspace_id), then DamInstance::checkUser() requires the DAM module (module 2) to be active for the workspace and the user's DAM role to be Admin, Manager or Viewer. Plan features are checked with DamInstance::checkFeatureRestriction() (see Subscription).

The backend has no upload, presigned-URL or multipart endpoint. The client stores the file in S3 first and then registers it: upload receives the stored file_name and a readable display_file URL, never the file bytes.

Endpoints ​

Admin API (/api/v1/digital-assets) ​

MethodPathController@methodPurpose
POST/uploadAssetController@uploadFileRegister an uploaded file as a new asset
POST/upload-folder-notificationAssetController@sendUploadFolderNotificationNotify after a folder upload finishes
POST/upload-zipfile-previewAssetController@uploadZipFilePreviewStore a client-made preview image as the thumbnail of an asset or version
GET/get-recent-uploaded, /get-external-uploaded, /total-recentAssetController@getRecentUploadedFiles, @getRecentExternalUploadedFiles, @getRecentUploadedCountUncategorised (recent) uploads
POST/view-detailAssetController@viewDetailsAsset detail; logs a view row in digital_assets_downloads, or an agent asset:viewed row in transaction_activities for MCP requests
POST/view-asset-countAssetController@viewAssetCountLog a view
POST/update-with-fieldAssetController@updateAssetsWithFieldUpdate one field on one asset
POST/update-multiple-fieldAssetController@updateMultipleAssetsWithFieldUpdate fields on many assets (or all uncategorised)
POST/update-aclAssetController@updateMultipleACLAdd or remove ACL ids on many assets
POST/multiple-file-folder-moveAssetController@moveMultipleFileOrFolderToFolderMove assets and folders
POST/multiple-file-copy-to-multiple-folderAssetController@copyMultipleFileToMultipleFolderCopy assets into one or more folders
POST/duplicate-to-foldersAssetController@duplicateAssetsToFoldersDuplicate assets into one or more folders, choosing which metadata the copies keep
POST/archive_assetsAssetController@archiveAssetsArchive or unarchive assets
POST/delete-fileAssetController@deleteFileHard delete assets (rows and S3 file)
POST/category/delete-category-with-filesCategoryController@deleteCategoryAndFilesMove assets and folders to trash
GET/category/get-deleted-category-with-filesCategoryController@getDeleteCategoryAndFilesList trash
POST/category/restore-deleted-category-with-filesCategoryController@restoreDeleteCategoryAndFilesRestore from trash
GET/category/all-restore-deleted-category-with-filesCategoryController@allRestoreDeleteCategoryAndFilesRestore everything in trash
POST/category/permanent-delete-category-with-filesCategoryController@permanentDeleteCategoryAndFilesDelete from trash for good
POST/version/uploadAssetController@uploadVersionFileAdd a new version
POST/version/make-current-versionAssetController@makeCurrentVersionMake an older version current
DELETE/version/{versionId}/removeAssetController@removeVersionAssetsRemove a version
GET/version/{versionId}/downloadAssetController@downloadVersionAssetsDownload one version
GET/object-downloadAssetController@getDownloadObjectSigned download URL for an asset or version
POST/convert-assetAssetController@assetsConvertQueue a format or size conversion
GET/{assetId}/generate-embed-codeAssetController@generateEmbedCodePublish the current version to the embed bucket
GET/embed-code-listAssetController@getEmbedAssetsListVersions with an embed code
POST/remove-embed-codeAssetController@removeEmbedCodeUnpublish embed codes
POST/analytics/summaryAssetController@assetSummaryDownload, view and share counts
POST/dashboard/file-download-historyDashboardController@fileDownloadHistoryDownload history
POST/api/v1/generate-zip-dataZipLinkController@generateAdminZipDataBuild a zip manifest for assets, folders or collages

Tags and custom fields have their own routes (add-tags-to-multiple-file, custom-field/*); see Admin API routes.

Portal API (/dam/v1/digital) ​

MethodPathController@methodPurpose
POST/view-detailAssetController@viewDetailsAsset detail for a partner
POST/view-all-assets-by-typeAssetController@viewAllAssetsByTypeAssets filtered by type
POST/check-private-assetsAssetController@checkPrivateAssetsPrivate asset check
POST/download-fileDashboardController@downloadFileSigned URL for one asset, logs download
POST/download-multiple-filesDashboardController@downloadMultipleFilesOne asset returns a URL; more queue a zip email
GET/object-downloadAssetController@getDownloadObjectSigned download URL
POST/download-count, /view-asset-countAssetController@downloadCount, @viewAssetCountLog a download or view
POST/convert-assetAssetController@assetsConvertQueue a conversion
POST/generate-zip-dataZipLinkController@generateDealerZipDataZip manifest for a partner

view-detail (portal) requires workspace_id (workspace url_slug), instance_id and digital_assets_id. It loads the asset with category, category.parent, tags (only vision_type = labels with a tag_name), user and assetProduct, skips deleted rows (is_deleted = 0, final_deleted = 0) and applies instanceVisible($instanceId); anything else returns the warning Assets not found. The response appends display_file, custom_fields (getAssetsCustomFieldsDealer()) and breadcrumb (the category, removed as category), and drops video_preview and file_preview_metadata. Every call writes a digital_assets_downloads row with type = view (download_by defaults to desktop). For an external upload (is_external_upload = 1) the user relation is replaced with the ExternalUser uploader through setRelation('user', ...) and externalUser is hidden; since 01f781f it is set as a relation rather than an attribute, so the serialized user key holds the external uploader instead of the backend user loaded by with('user').

External API (/external/v1) ​

MethodPathController@methodPurpose
POST/get-file-by-type, /get-file-detailExternal\AssetsController@getAllAssetsByType, @getDetailRead assets
POST/download-files, /download-countExternal\AssetsController@downloadMultipleFiles, @downloadCountDownload and log
POST/generate-embed-codeExternal\AssetsController@generateEmbedCodeEmbed code
GET/embed-code-listExternal\AssetsController@getEmbedAssetsListEmbedded assets
POST/add-tagExternal\AssetsController@addTagToAssetsTag assets
POST/get-thumbnailExternal\AssetsController@getThumbnailByEmbedThumbnail from an embed code

Workflows ​

Upload ​

Required fields: url_workspace_id, auto_tag, display_file, display_file_name, file_extension, file_name, file_size. Without category_id the asset is an uncategorised recent upload (is_recent = 1); with one, the folder must belong to the workspace (Folder is not found.). When the folder is public in a portal (DamInstancePermission.visibility = 0), the asset gets a public row for that portal too. With no row the asset is private in that portal (see Portals). Auto tagging needs the ai_based_asset_auto_tagging feature, auto_tag = 1, constant.AUTO_TAG, an image or application type under 20 MB and one of png, jpg, jpeg, gif, bmp, webp, raw, ico, pdf, tiff. The Vision request asks for faces, objects, labels and image properties; results are stored as DigitalAssetsTag rows with vision_type faces, objects, labels or properties, and up to 10 labels are returned with the asset. After a folder upload the client calls upload-folder-notification, which queues one upload-new-asset-folder system notification.

List and detail responses append the display_file accessor (URL of the original file) only for file types whose preview needs the original. Since 74589f51 and 1ad517ad md is on every list:

WhereFile types
Admin folder lists (CategoryController@getCategoryAndFiles, getCategoryAndFilesUltraOptimized and the two ...Old variants), Admin collage asset list (DamCollectionController@getCollectionAssetList), Portal folder list (DAM\v1\Digital\CategoryController@getCategoryAndFiles), Portal collage assets (DamCollectionController@getCollectionAssets), Typesense toSearchableArray()gif, pdf, doc, docx, ppt, pptx, xlsx, xls, dotx, odt, ott, txt, svg, md
Portal home trending and recent uploads (DAM\v1\Digital\DashboardController@getAllCommonData via buildCommonDashboardData, GET /dam/v1/digital/common-data, cached 300 s per workspace and portal). md was added, so md cards on the portal home get display_file after the cache entry expiresgif, pdf, doc, docx, ppt, pptx, xlsx, xls, dotx, odt, ott, txt, svg, md
Share links (ShareAssetsController@showShareAssets, getSharedCategoryAndFiles, searchShareData)the list above plus video types mp4, mkv, webm, mov, mpeg-4, mpeg, 3gp, avi, wmv, flv, m4v, ts

Other types return no display_file; clients use thumbnail_file / compress_file.

ZIP preview thumbnail ​

ZIP files have no server-made thumbnail. After a ZIP finishes uploading, the Collage Admin uploader renders a preview of the archive's contents in the browser and, when that gives a thumbnailResponse.signedUrl, posts the URL as compress_file to one of two endpoints (collage-admin f922a132):

Who uploadsEndpointBodyAsset lookup
Workspace user, new assetPOST /api/v1/digital-assets/upload-zipfile-preview (AssetController@uploadZipFilePreview)workspace_id, compress_file, asset_idDigitalAssets by asset_id only, after DamInstance::checkUser()
Workspace user, new versionsameworkspace_id, compress_file, version_idAssetsVersion by version_id; updates the version and its asset
External upload user (check.external, not a version)POST /api/v1/upload-zip-preview (ExternalUserController@uploadZipPreview, Backend-API bf840985)workspace_id, compress_file, asset_idAsset in the external user's workspace, uploaded by that user, is_external_upload = 1

The external endpoint exists because external upload tokens cannot pass DamInstance::checkUser(). It takes the workspace from the signed-in external user, never from the request; a workspace_id that differs from that workspace's url_slug is rejected. Checks run in this order:

Both endpoints size the image with DigitalAssets::getThumbnailSize() (capped at config('app.THUMBNAIL_WIDTH') x config('app.THUMBNAIL_HEIGHT'), falling back to those sizes when the image cannot be read), keep the aspect ratio, store a PNG under the asset's own file_name in the thumbnail folder, and set thumbnail_file and compress_file to file_name on the asset and every AssetsVersion row of it. A missing external user returns Whoops something went wrong. Please try again. (422); any exception returns the exception message. The uploader ignores failures of this call.

Example request (external user):

json
{
  "workspace_id": "acme",
  "asset_id": 12,
  "compress_file": "<signed-url-of-preview-png>"
}

Processing (AssetUpload job) ​

Image processing is best effort: a failure logs a warning and leaves the thumbnail empty, the asset row is still saved. A FilePreviews HTTP 429 releases the job with backoff (up to 300 seconds plus jitter) until the job's tries run out, then saves without a preview. Previews that finish later arrive at the public POST /api/v1/filepreviews/webhook (WebhookController@filePreviewWebhook), which finds the asset by file_preview_id, writes the renditions, updates the version and reindexes. GenerateVideoPreviewJob builds a preview file with DigitalAssets::generateFileFromVideo() and stores it under video_preview/. Weekly commands file-preview:generate (DAMGenerateAssetsPreview) and file-preview:status (DamFilePreviewCheck) run on Sundays to generate previews and renditions that are still missing; see Jobs.

Update fields and ACL ​

Setting is_public back to 1 clears watermark_file and watermark_original_file. update-multiple-field does the same for a list of ids, or for every uncategorised, live asset when digital_assets_id is all. update-acl takes field_value.add_permission and field_value.remove_permission arrays and merges them into each asset's comma separated acl_permission. ACL definitions themselves are managed through acl/* (ACLController).

Move ​

Assets with no move_id cannot be moved (they would become uncategorised again). For each portal, a moved asset becomes public (0) when the target folder is public there and private (1) otherwise. If inline reindexing throws, the same ids are queued instead.

Copy ​

Copies are physical: each copy gets its own S3 objects, so it counts toward storage.

Duplicate ​

POST /api/v1/digital-assets/duplicate-to-folders (AssetController@duplicateAssetsToFolders, added in 9c9de48) is a second copy endpoint next to Copy. It makes one copy of every listed asset in every listed folder (assets x folders) and lets the caller choose which metadata the copies keep. multiple-file-copy-to-multiple-folder is unchanged.

Caller: collage-admin's duplicate-asset dialog (useFolderApi.copyFile, merged in 165173c0) always sends copy_mode and adds copy_options only for selected. See Duplicate Asset Flow.

Request

FieldRuleNotes
url_workspace_idrequiredWorkspace url_slug.
digital_assets_idrequired|arrayAssets to duplicate. Ids from another workspace, trashed (is_deleted) or permanently deleted (final_deleted) are skipped without an error.
category_idrequired|arrayDestination folders. Ids from another workspace are skipped.
copy_modenullable|string|in:everything,nothing,selectedDefault everything.
copy_optionsnullable|array, each value nullable|booleanRead only when copy_mode=selected. Keys: portal_visibility, description, tags, custom_fields, collections, versions. A missing key is off.

resolveDuplicateCopyOptions() turns the mode into one boolean per key: everything switches all six on, nothing switches all off, selected takes each key from copy_options through FILTER_VALIDATE_BOOLEAN. The resolved set is echoed back in the response.

json
{
  "url_workspace_id": "acme",
  "digital_assets_id": [101, 102],
  "category_id": [12, 15],
  "copy_mode": "selected",
  "copy_options": { "description": true, "tags": true }
}

What each option carries over

KeyOnOff
portal_visibilityCopies the source's DamInstancePermission rows (same visibility per portal), then recalculates the destination folder chain.is_public = 0 (fresh-upload default) and the copy gets a visibility = 0 row for every portal where the destination folder is fully public (inheritFolderPortalVisibility(), same rule as upload).
descriptionKept.null on the asset and on every copied version row.
tagsEvery digital_assets_tags row (manual and auto tags), in chunks of 500, re-pointed to the matching new version id (or the copy's current version when there is no match).No tags.
custom_fieldsassets_custom_fields values (value, status), skipping fields whose custom_fields.deleted_at is set.No values.
collectionsAdds the copy to every live collage of the source in the same workspace (dam_collections.deleted_at null) and bumps those collages' modified_at.Not in any collage.
versionsEvery live version row (is_deleted = 0, final_deleted = 0), in version then id order, each with its own S3 objects.Only the current version (the source's assets_version_id if it is live, else the newest live version), saved as version = 1.

Always, whatever the options:

  • New S3 objects for the original, thumbnail (public) and compressed file (private) of the asset and each copied version, so copies count toward storage.
  • file_name is a random 32-hex key (bin2hex(random_bytes(16))). The code comment gives the reason: the older time() + rand(0, 100) name allowed only 101 names per second, so copies made in the same second could share one S3 object. Copy still uses the old naming.
  • share_id, watermark_file and watermark_original_file are cleared; copied versions get is_embed_code = 0, embed_key = null, embed_code_date = null. Share history and embed codes stay with the original.
  • Insights (views, downloads, share analytics) are keyed by asset id, so the copy starts at zero. modified_at is now.
  • The copy never points at one of the source's version rows: if assets_version_id is not among the new version ids it is set to the last copied version (or null).

Flow and errors

OrderCheckResponse
1Validator400 Woops! Validation is failed. with the field errors
2url_workspace_id matches no workspace402 Workspace is not available.
3DamInstance::checkUser()402 with its message (DAM module or role)
4checkFeatureRestriction(..., "storage")402 with the plan message
5No category_id belongs to the workspace402 Folder is not found.
6No live digital_assets_id in the workspace402 Asset(s) is not found.
7Any exceptionRollback, RestResponse::error() with the exception message

Portal visibility recalculation (only when portal_visibility is on): FolderVisibilityRecalculator::collectAncestors() takes the destination folders plus all their ancestors, and recalculate() re-derives each folder's state (0 fully public, 2 partially, 1 hidden) on every portal that the copies were published to or that already has permission rows on that chain. A copied portal state can differ from the destination folder's, which is why this runs.

After commit, jobs run outside the transaction: GenerateVideoPreviewJob on queue video-previews for videos, and AssetApplyWatermark on queue high for copies that are not public (is_public = 0) with file_type jpg, jpeg or png. A failed dispatch is only logged (Duplicate asset: post-commit job dispatch failed). Search is then updated from committed rows: ReindexAssetsByIds::reindex() for the new assets, ReindexAssetTagsByAssetIds::reindex() when tags were copied, and searchable() on the recalculated folders and touched collages; a failure is logged (Duplicate asset: reindex failed) and does not fail the request. Finally forgetDamDashboardCache().

Response

json
{
  "status": true,
  "message": "Asset(s) copied to folders successfully.",
  "data": {
    "copy_options": { "portal_visibility": false, "description": true, "tags": true, "custom_fields": false, "collections": false, "versions": false },
    "duplicated": [
      { "source_asset_id": 101, "category_id": 12, "asset_id": 9001 },
      { "source_asset_id": 101, "category_id": 15, "asset_id": 9002 }
    ]
  }
}

Edge cases:

  • The loops walk the request arrays as sent, so an asset or folder id listed twice is duplicated twice.
  • S3 objects are written inside the database transaction. If a later step throws, the rows roll back but objects already written stay in S3 with no row pointing at them.
  • Unlike Copy, the copy keeps the source's portal state only when asked; with portal_visibility off it behaves like a fresh upload into the destination folder.

Versions ​

make-current-version copies the chosen version's columns back onto the asset, reapplies watermarks and refreshes the embed code. version/{id}/remove marks the version is_deleted and final_deleted; when current_version=true the next newest live version becomes current first. Note: the plan checks in these endpoints do not block today. uploadVersionFile tests array_key_exists($key, ['storage', 'asset_versioning']) against list indexes, and makeCurrentVersion / removeVersionAssets pass the feature name as the workspace id to checkFeatureRestriction().

Archive, trash and restore ​

Trash is soft: is_deleted = 1 on assets and versions plus a soft-deleted folder. On restore, a folder whose parent is still in the trash is restored at root with visibility = 0; otherwise it gets 0 when the parent's visibility is 0, else 1 (root folders get 1). permanent-delete-category-with-files sets final_deleted = 1 and deletes the S3 objects. The dam:assets-delete command (PermanentDeleteAssets, daily 09:10) does the same for anything trashed more than 30 days ago. archive_assets is a separate flag (is_archive, archive_by) that hides assets without trashing them; archiving sends the same system notification. delete-file is a hard delete for a list of ids, or for every live uncategorised upload when assets_ids is all: it removes the S3 object, tags and the row immediately.

Download ​

object-download accepts attachment_type Digital Assets or Version Asset; anything else returns Invalid Attachment Type.. generate-zip-data needs at least one of assets_ids, category_ids, collection_ids, walks folder subtrees and collages for live assets, and returns a manifest (workspaceId, zipFileName, files) as reversed base64 JSON. This API does not build that zip; it only returns the manifest. On the portal, download-multiple-files with more than one asset dispatches DownloadMultipleFilesForDealer, which emails the zip (Zip file sent in your email address.). Converted files come from ConvertAssetsJob (needs the asset_conversion feature) and are emailed as a link; DAMRemoveAssetConvertFile and DAMRemoveAssetDownloadFile clean them up daily.

Embed codes ​

The embed URL is stable per asset ({slug}/md5(asset_id) on the s3Cloudfront disk), so uploading or switching versions replaces the object behind the same URL. remove-embed-code deletes the object, creates a CloudFront invalidation and sets is_embed_code = 0. Trashing an asset also turns its embed off. The asset_embedding plan check in these three endpoints has the same argument-order problem as the version endpoints, so it does not block.

Analytics ​

Counts come from digital_assets_downloads.type (download, view, share) for the current version only. An invalid date range returns 400 Invalid date range pass.. Since d17bb30 each bar_data day is a whole day in the user's profile timezone (users.timezone, UTC when unset or invalid), converted to app-timezone boundaries and compared with whereBetween('created_at', ...); before, DATE(created_at) compared the server's day. See viewer timezone for analytics. Portal and share-page activity is also written to transaction_activities by the transaction-activity endpoints.

Since 8d907a3 an asset opened by the Collage MCP agent (X-Collage-Client: mcp/<version>, or the collage-mcp/<version> User-Agent) writes no view row to digital_assets_downloads; view-detail records it in transaction_activities with environment = 'agent' instead. Agent reads therefore never appear in these view counts. See Agent (MCP) requests in analytics.

Data ​

Model / tableUse
DigitalAssets / digital_assetsAsset row; flags is_recent, is_public, is_archive, is_deleted, visible_in_trashed, final_deleted
AssetsVersion / assets_versionsVersions, embed flags (is_embed_code, embed_key)
DigitalAssetsTag / digital_assets_tagsManual and Vision tags
DigitalAssetsCategory / digital_assets_categoriesFolder of the asset
DamInstancePermissionPer-portal visibility of assets and folders
DigitalAssetsDownload / digital_assets_downloadsDownload, view, share log
TransactionActivity / transaction_activitiesActivity log
DamAssetsConvert / dam_assets_convertsConversion requests
AssetsCustomFieldCustom field values (deleted on permanent delete)