ContentAsset

Represents the metadata for creating an asset file. Asset files enable a Salesforce file to be used for org setup and configuration purposes.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type 

This type extends MetadataWithContent and inherits its fields.

File Suffix and Directory Location 

ContentAsset components have the suffix .asset and are stored in the contentassets folder.

Version 

Introduced in API version 38.0.

Special Access Rules 

The system prevents metadata retrieval if the total size of the asset’s file content exceeds 30 MB. All pre-existing limits for packaging apply to asset files.

Fields 

format 

  • Type: ContentAssetFormat (enumeration of type string)
  • Required: No
  • Description: Describes the format of the asset file.
  • Possible values:
    • Original — A single asset file version.
    • ZippedVersions — Contains multiple versions of the asset file.

isVisibleByExternalUsers 

  • Type: boolean
  • Required: No
  • Introduced: API version 44.0
  • Description: Indicates whether unauthenticated users can see the asset file (true) or not (false). If not specified, the default value is false.

language 

  • Type: string
  • Required: Yes
  • Description: Required. The language of the asset file label.

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. The label for the asset file record, which displays in Setup.

originNetwork 

  • Type: string
  • Required: No
  • Description: For deploys, the name of the Experience Cloud site the file is assigned upon creation. For retrievals, the name of the Experience Cloud site the file is assigned to appears in the field value. If null, the file wasn’t assigned to an Experience Cloud site.

relationships 

  • Type: ContentAssetRelationships
  • Required: No
  • Description: The list of ContentAssetLinks that describe whether the asset file can be shared with the org.

versions 

  • Type: ContentAssetVersions
  • Required: Yes
  • Description: Required. Captures basic information about the file version included the asset metadata. Typically the file has only one version.

ContentAssetLink Type 

Represents a relationship link for an asset file, and includes details about the level of access for the link.

Fields 

access 

  • Type: ContentAssetAccess (enumeration of type string)
  • Required: Yes
  • Description: Required. The permission granted to the user of the shared file, determined by the permission the user already has.
  • Possible values:
    • VIEWER
    • COLLABORATOR
    • INFERRED

isManagingWorkspace 

  • Type: boolean
  • Required: No
  • Introduced: API version 39.0
  • Description: Indicates whether the content asset resides in the workspace or not. When true, the content asset resides in the workspace. If not specified, the default value is false.

name 

  • Type: string
  • Required: No
  • Description: Reserved for future use.

ContentAssetRelationships Type 

Represents the relationships between an asset file and the locations it’s linked with.

Fields 

emailTemplate 

  • Type: ContentAssetLink[]
  • Required: No
  • Introduced: API version 51.0
  • Description: An array of email templates the content asset is related to.

insightsApplication 

  • Type: ContentAssetLink[]
  • Required: No
  • Introduced: API version 39.0
  • Description: An array of the insights applications that use the content asset.

network 

  • Type: ContentAssetLink[]
  • Required: No
  • Introduced: API version 39.0
  • Description: An array of networks that use the content asset.

organization 

  • Type: ContentAssetLink
  • Required: No
  • Introduced: API version 39.0
  • Description: Stores information about sharing the asset file with the org. Maps to ContentDocumentLink.

workspace 

  • Type: ContentAssetLink[]
  • Required: No
  • Introduced: API version 39.0
  • Description: An array of workspaces and libraries that own or share the content asset.

ContentAssetVersion Type 

Represents information about one file version included in the asset metadata.

Fields 

number 

  • Type: string
  • Required: Yes
  • Description: Required. The version number. This field is based on, or sets, the ContentVersion.

pathOnClient 

  • Type: string
  • Required: Yes
  • Description: Required. Describes the original filename of the file. This field maps to ContentVersion.PathOnClient. It provides the data for the ContentVersion Title field.

zipEntry 

  • Type: string
  • Required: No
  • Description: If the asset file has more than one version, format is ZippedVersions. In this case, zipEntry is the name of the file within the zip. If the asset file has only one version, this field is empty.

ContentAssetVersions Type 

Represents information about all file versions included in the asset metadata.

Fields 

version 

Declarative Metadata Sample Definition 

The following is an example of a ContentAsset component.

1<?xml version="1.0" encoding="UTF-8"?>
2<ContentAsset xmlns="http://soap.sforce.com/2006/04/metadata">
3    <masterLabel>some asset</masterLabel>
4    <relationships>
5        <organization>
6            <access>VIEWER</access>
7        </organization>
8    </relationships>
9    <versions>
10        <version>
11            <number>1</number>
12            <pathOnClient>some asset.txt</pathOnClient>
13        </version>
14    </versions>
15</ContentAsset>

For assets that include just one version, the format field can be omitted or specified with the value as Original. File assets with more than one version have versions wrapped in a zip file.

The following is an example package.xml that references the previous definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>MyAsset</members>
5        <name>ContentAsset</name>
6    </types>
7    <version>68.0</version>
8</Package>

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.