ContentAsset makes a Salesforce file available for org setup and configuration, including application logos, Experience Cloud branding, and component images. It combines file content with metadata for sharing, site assignment, and included file versions.
This type extends MetadataWithContent and inherits content and fullName. It represents configuration metadata for a file asset, not the similarly named business Asset record.
Key Elements
| Element | What the Element Controls |
|---|---|
format |
How the file content is packaged. Use Original, or omit the element, for one file version. Use ZippedVersions for multiple versions contained in a zip file. |
isVisibleByExternalUsers |
Whether unauthenticated users can see the asset. Defaults to false when omitted. This is separate from org sharing and site or library relationships. |
language |
Required. The language of the asset label. |
masterLabel |
Required. The asset record's label in Setup. It is distinct from the filename recorded for each file version. |
originNetwork |
The Experience Cloud site name. Deployment uses it to assign the file to a site upon creation; retrieval reports the assigned site. A null value indicates no site assignment. |
organization under relationships
|
Sharing with the org. This relationship maps to ContentDocumentLink. |
workspace under relationships
|
Libraries and workspaces that own or share the asset. |
emailTemplate, insightsApplication, network under relationships
|
Links to related email templates, applications, and networks. |
access within a relationship link |
Required for each link. Allowed values are VIEWER, COLLABORATOR, and INFERRED. The documented permission interpretation takes the user's existing permissions into account. |
isManagingWorkspace within a workspace link |
When true, the asset resides in that workspace. Defaults to false. |
versions |
Required. Contains version entries describing the included file content. |
number within versions.version
|
Required. The file version number, based on or used to set the ContentVersion number. |
pathOnClient within versions.version
|
Required. The original filename. Maps to ContentVersion.PathOnClient and supplies data for ContentVersion.Title. |
zipEntry within versions.version
|
For multiple versions, identifies the file within the zip payload. It is empty for an asset containing one version. |
Behavior and Constraints
Org sharing, unauthenticated visibility, and site assignment are different controls. Setting isVisibleByExternalUsers does not replace an organization relationship. Likewise, linking an asset to a site or library should not be treated as equivalent to sharing it with the org.
Each relationship link requires access. The link's name element is reserved for future use; it is not a documented place to supply a related component's developer name. For a workspace link, isManagingWorkspace=true identifies where the asset resides, rather than merely indicating a sharing relationship.
originNetwork references Network by the Experience Cloud site name. Its deployment behavior describes assignment when the file is created. It is not a documented instruction for moving an existing asset between sites. For site-bound assets, the destination site's identity and the deployment user's access can affect deployment.
Interpret format, the payload, and versions together. A single-version asset uses the original file content, with format omitted or set to Original and an empty zipEntry. A multiple-version asset uses ZippedVersions, with each version's zipEntry naming its file inside the zip.
The asset label and file title come from different metadata. masterLabel labels the asset record in Setup, and language applies to that label. Each version's pathOnClient records the original filename and supplies data for the corresponding ContentVersion.Title.
Deployment and Retrieval
ContentAsset components use the .asset suffix and reside in the contentassets folder. Retrieval includes the file payload and accompanying metadata. In package.xml, use ContentAsset as the type name and list the asset members to retrieve or deploy. The type also supports the * wildcard in the manifest.
Metadata retrieval is prevented when the total size of an asset's file content exceeds 30 MB. This is a limit on the asset's total content, not a separately stated allowance for each included version. Existing packaging limits also apply to asset files. The ContentAsset reference describes the file structure and manifest support.
For an image update, changed metadata details alone do not establish that the underlying file was replaced. The included file payload and versions metadata are both relevant when diagnosing an unchanged image. There is no documented universal requirement here to increment number for every deployment.
Application-logo deployment has two separate dependency checks: the referenced asset must be available, and its sharing must meet the application's requirements. Deploying the asset separately does not, by itself, establish org sharing. For Experience Cloud assets, having Network metadata in the local project does not establish that the named site is available in the destination.
Missing packaged assets can also affect package upgrades. A reported failure involving suspected subscriber-side deletion does not establish a general subscriber-deletion rule or a guaranteed restoration procedure.
Relationships
The outgoing site assignment is separate from the incoming references that use an asset for branding, images, or messaging. These connections identify possible consumers; they do not establish that a particular component is present in an org or uses a particular asset. Runtime objects such as ContentVersion and ContentDocumentLink describe the underlying file and sharing records, rather than additional metadata consumers.
References
-
Network:originNetwork, using the Experience Cloud site name.
Referenced By
-
ChatterExtension:icon. -
CommunityTemplateDefinition:image,tileImage. -
CommunityThemeDefinition:image. -
ConversationMessageDefinition:contentAssetName. -
CustomApplication:logowithinbrand. -
LightningBolt:image. -
LightningWebComponent: embedded references withinfiledata. -
NavigationMenu:tileImage. -
Network:tileImage. -
Prompt:image. -
SvcCatalogCategory:image.
Embedded usage: ExperienceBundle branding-set JSON can also contain asset usage. This is separate from the element references listed above. Runtime ContentDocumentLink records linked to a network can help inventory associated files, but that inventory does not necessarily identify active rendering or every metadata consumer.
Reported Issues
-
A custom application can fail because its logo asset was omitted from retrieval. In a 2016 report, deployment returned "In field: logo - no ContentAsset named ... found". Adding the named asset as a
ContentAssetmember inpackage.xmlretrieved its payload and metadata, and the next build deployed successfully. See the application-logo retrieval report. -
An existing logo asset can still fail the org-sharing check. A 2019 report resolved "The image asset used for Logo isn't shared with the organization" by adding
relationships, anorganizationlink, andaccess=VIEWER. The asset retainedisVisibleByExternalUsers=false, illustrating that org sharing and unauthenticated visibility are separate. See the logo-sharing resolution. - Local site metadata did not prevent a "No Network named" deployment failure. During a 2019 scratch-org migration, the project contained the expected network metadata, but the asset deployment could not find the named site in the destination. An answer reported success after creating the destination site with the same name and URL, then renaming it and renaming it back. That rename workaround is not a general deployment requirement. See the site-identity discussion.
- Experience Cloud file access caused deployment failures for a non-System Administrator user. In April 2024, a report resolved insufficient-access errors by making the deployment user a site member and granting Access Libraries. Libraries in Salesforce Files was already enabled. These are reported diagnostic conditions, not a universal requirement to use a particular profile. See the Experience Cloud deployment-access report.
-
Asset details changed while the deployed image stayed unchanged. In August 2024, the author attributed this symptom to an incomplete retrieval that left
versionsunchanged. The report makes the payload and version metadata relevant diagnostic inputs; it does not establish that every deployment requires a version-number increment. See the unchanged-image report. -
Searching only retrieved XML can miss Experience Cloud branding usage. A 2020 answer located asset names in
ExperienceBundleJSON underbrandingSets. A 2023 answer usedContentDocumentLinkrecords linked to aNetworkto inventory associated files and reported needing Asset Library membership or Query All Files for visibility. Linked files are not necessarily actively rendered assets or a complete consumer list. See the Experience Cloud asset-inventory discussion. - A managed-package upgrade failed with "Data Not Available" for app-logo assets. The 2023 second-generation managed-package report suspected that files had been deleted in the subscriber sandbox. Deletion remained a diagnostic hypothesis; the discussion did not establish a general subscriber-deletion rule or guaranteed recovery procedure. See the packaged-asset upgrade report.
- Replacing a scratch-org application logo produced missing-asset errors during source retrieval. A 2018 report and 2021 answers described deleted assets and stale local source-tracking references as possible factors. Reported outcomes differed: emptying the recycle bin helped one respondent but not others; other respondents reported success by removing stale local tracking references or recreating files with the missing names in the Asset Library. These are tool-specific reports, not a general asset-removal procedure. See the scratch-org logo conflict discussion.
-
An HTML Editor image reference can depend on the asset expression rather than the uploaded filename. In a 2019 Experience Cloud discussion, an answer demonstrated
{!contentAsset.GetLogo.1}for an Asset Library image uploaded asGetLogo.png: the expression omitted the extension and included the version suffix.1. This was a reported working example, not a rule that every asset uses version 1. See the HTML Editor asset-reference discussion.
Common Questions
Why does my application logo fail deployment when the ContentAsset already exists?
Existence and org sharing are separate checks. A reported resolution for "The image asset used for Logo isn't shared with the organization" added an organization relationship with access=VIEWER. It did not require enabling unauthenticated visibility.
Why did ContentAsset deployment update the label but not the image?
The label is metadata, while the image is file content described by versions. A reported case traced this symptom to an incomplete retrieval that left the version metadata unchanged. Check the included payload and version entries; the report does not establish a mandatory version-number increment for every deployment.
What does originNetwork mean, and why do I get "No Network named"?
originNetwork names the Experience Cloud site assigned when the file is created. Retrieval reports the assigned site. A local Network file does not establish that the named site is available in the destination, and the field is not a documented mechanism for moving an existing asset between sites.
What is the ContentAsset retrieval size limit?
Metadata retrieval is prevented when an asset's total file content exceeds 30 MB. The limit applies to the asset's total content, not independently to each version. Existing packaging limits also apply.
How do I find ContentAssets used by an Experience Cloud site?
Inspect the site's ExperienceBundle branding-set JSON and relevant metadata consumers. A reported alternative inventories ContentDocumentLink records linked to the network, with Asset Library membership or Query All Files needed for visibility. That inventory shows associated files, not necessarily active usage or every consumer.