Appearance
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) ​
| Method | Path | Controller@method | Purpose |
|---|---|---|---|
| POST | /upload | AssetController@uploadFile | Register an uploaded file as a new asset |
| POST | /upload-folder-notification | AssetController@sendUploadFolderNotification | Notify after a folder upload finishes |
| POST | /upload-zipfile-preview | AssetController@uploadZipFilePreview | Store a client-made preview image as the thumbnail of an asset or version |
| GET | /get-recent-uploaded, /get-external-uploaded, /total-recent | AssetController@getRecentUploadedFiles, @getRecentExternalUploadedFiles, @getRecentUploadedCount | Uncategorised (recent) uploads |
| POST | /view-detail | AssetController@viewDetails | Asset detail; logs a view row in digital_assets_downloads, or an agent asset:viewed row in transaction_activities for MCP requests |
| POST | /view-asset-count | AssetController@viewAssetCount | Log a view |
| POST | /update-with-field | AssetController@updateAssetsWithField | Update one field on one asset |
| POST | /update-multiple-field | AssetController@updateMultipleAssetsWithField | Update fields on many assets (or all uncategorised) |
| POST | /update-acl | AssetController@updateMultipleACL | Add or remove ACL ids on many assets |
| POST | /multiple-file-folder-move | AssetController@moveMultipleFileOrFolderToFolder | Move assets and folders |
| POST | /multiple-file-copy-to-multiple-folder | AssetController@copyMultipleFileToMultipleFolder | Copy assets into one or more folders |
| POST | /duplicate-to-folders | AssetController@duplicateAssetsToFolders | Duplicate assets into one or more folders, choosing which metadata the copies keep |
| POST | /archive_assets | AssetController@archiveAssets | Archive or unarchive assets |
| POST | /delete-file | AssetController@deleteFile | Hard delete assets (rows and S3 file) |
| POST | /category/delete-category-with-files | CategoryController@deleteCategoryAndFiles | Move assets and folders to trash |
| GET | /category/get-deleted-category-with-files | CategoryController@getDeleteCategoryAndFiles | List trash |
| POST | /category/restore-deleted-category-with-files | CategoryController@restoreDeleteCategoryAndFiles | Restore from trash |
| GET | /category/all-restore-deleted-category-with-files | CategoryController@allRestoreDeleteCategoryAndFiles | Restore everything in trash |
| POST | /category/permanent-delete-category-with-files | CategoryController@permanentDeleteCategoryAndFiles | Delete from trash for good |
| POST | /version/upload | AssetController@uploadVersionFile | Add a new version |
| POST | /version/make-current-version | AssetController@makeCurrentVersion | Make an older version current |
| DELETE | /version/{versionId}/remove | AssetController@removeVersionAssets | Remove a version |
| GET | /version/{versionId}/download | AssetController@downloadVersionAssets | Download one version |
| GET | /object-download | AssetController@getDownloadObject | Signed download URL for an asset or version |
| POST | /convert-asset | AssetController@assetsConvert | Queue a format or size conversion |
| GET | /{assetId}/generate-embed-code | AssetController@generateEmbedCode | Publish the current version to the embed bucket |
| GET | /embed-code-list | AssetController@getEmbedAssetsList | Versions with an embed code |
| POST | /remove-embed-code | AssetController@removeEmbedCode | Unpublish embed codes |
| POST | /analytics/summary | AssetController@assetSummary | Download, view and share counts |
| POST | /dashboard/file-download-history | DashboardController@fileDownloadHistory | Download history |
| POST | /api/v1/generate-zip-data | ZipLinkController@generateAdminZipData | Build 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) ​
| Method | Path | Controller@method | Purpose |
|---|---|---|---|
| POST | /view-detail | AssetController@viewDetails | Asset detail for a partner |
| POST | /view-all-assets-by-type | AssetController@viewAllAssetsByType | Assets filtered by type |
| POST | /check-private-assets | AssetController@checkPrivateAssets | Private asset check |
| POST | /download-file | DashboardController@downloadFile | Signed URL for one asset, logs download |
| POST | /download-multiple-files | DashboardController@downloadMultipleFiles | One asset returns a URL; more queue a zip email |
| GET | /object-download | AssetController@getDownloadObject | Signed download URL |
| POST | /download-count, /view-asset-count | AssetController@downloadCount, @viewAssetCount | Log a download or view |
| POST | /convert-asset | AssetController@assetsConvert | Queue a conversion |
| POST | /generate-zip-data | ZipLinkController@generateDealerZipData | Zip 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) ​
| Method | Path | Controller@method | Purpose |
|---|---|---|---|
| POST | /get-file-by-type, /get-file-detail | External\AssetsController@getAllAssetsByType, @getDetail | Read assets |
| POST | /download-files, /download-count | External\AssetsController@downloadMultipleFiles, @downloadCount | Download and log |
| POST | /generate-embed-code | External\AssetsController@generateEmbedCode | Embed code |
| GET | /embed-code-list | External\AssetsController@getEmbedAssetsList | Embedded assets |
| POST | /add-tag | External\AssetsController@addTagToAssets | Tag assets |
| POST | /get-thumbnail | External\AssetsController@getThumbnailByEmbed | Thumbnail 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.
Original-file link (display_file) ​
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:
| Where | File 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 expires | gif, 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 uploads | Endpoint | Body | Asset lookup |
|---|---|---|---|
| Workspace user, new asset | POST /api/v1/digital-assets/upload-zipfile-preview (AssetController@uploadZipFilePreview) | workspace_id, compress_file, asset_id | DigitalAssets by asset_id only, after DamInstance::checkUser() |
| Workspace user, new version | same | workspace_id, compress_file, version_id | AssetsVersion 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_id | Asset 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
| Field | Rule | Notes |
|---|---|---|
url_workspace_id | required | Workspace url_slug. |
digital_assets_id | required|array | Assets to duplicate. Ids from another workspace, trashed (is_deleted) or permanently deleted (final_deleted) are skipped without an error. |
category_id | required|array | Destination folders. Ids from another workspace are skipped. |
copy_mode | nullable|string|in:everything,nothing,selected | Default everything. |
copy_options | nullable|array, each value nullable|boolean | Read 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
| Key | On | Off |
|---|---|---|
portal_visibility | Copies 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). |
description | Kept. | null on the asset and on every copied version row. |
tags | Every 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_fields | assets_custom_fields values (value, status), skipping fields whose custom_fields.deleted_at is set. | No values. |
collections | Adds 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. |
versions | Every 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_nameis a random 32-hex key (bin2hex(random_bytes(16))). The code comment gives the reason: the oldertime() + 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_fileandwatermark_original_fileare cleared; copied versions getis_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_atis now. - The copy never points at one of the source's version rows: if
assets_version_idis not among the new version ids it is set to the last copied version (ornull).
Flow and errors
| Order | Check | Response |
|---|---|---|
| 1 | Validator | 400 Woops! Validation is failed. with the field errors |
| 2 | url_workspace_id matches no workspace | 402 Workspace is not available. |
| 3 | DamInstance::checkUser() | 402 with its message (DAM module or role) |
| 4 | checkFeatureRestriction(..., "storage") | 402 with the plan message |
| 5 | No category_id belongs to the workspace | 402 Folder is not found. |
| 6 | No live digital_assets_id in the workspace | 402 Asset(s) is not found. |
| 7 | Any exception | Rollback, 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_visibilityoff 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 / table | Use |
|---|---|
DigitalAssets / digital_assets | Asset row; flags is_recent, is_public, is_archive, is_deleted, visible_in_trashed, final_deleted |
AssetsVersion / assets_versions | Versions, embed flags (is_embed_code, embed_key) |
DigitalAssetsTag / digital_assets_tags | Manual and Vision tags |
DigitalAssetsCategory / digital_assets_categories | Folder of the asset |
DamInstancePermission | Per-portal visibility of assets and folders |
DigitalAssetsDownload / digital_assets_downloads | Download, view, share log |
TransactionActivity / transaction_activities | Activity log |
DamAssetsConvert / dam_assets_converts | Conversion requests |
AssetsCustomField | Custom field values (deleted on permanent delete) |
Related ​
- Jobs:
AssetUpload,GenerateVideoPreviewJob,ConvertAssetsJob,AssetApplyWatermark,DownloadMultipleFilesForDealer,ReindexAssetsByIds - DAM models, Controllers
- Search for indexing, Folders, Collages, Portals for visibility
- Frontend: Asset Management, Trash, Download & Export